about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2017-12-15 09:26:57 -0500
committerGitHub <noreply@github.com>2017-12-15 09:26:57 -0500
commit6e956298129ccc17c0742acdbb9d3fc57f647203 (patch)
tree5e8f2a30e70497e61147d4ac96005f84acd64786
parentba67acc0e743e45fe6e42387d2e6c5d97667bd48 (diff)
parentdffa36c0052d9758f8f28d35d62ab3fdca4e53cc (diff)
downloadrust-6e956298129ccc17c0742acdbb9d3fc57f647203.tar.gz
rust-6e956298129ccc17c0742acdbb9d3fc57f647203.zip
Rollup merge of #46652 - ishitatsuyuki:thinlto-backport, r=alexcrichton
ThinLTO: updates for LLVM 5

refs:

https://github.com/llvm-mirror/llvm/commit/ccb80b9c0f60f33780e5e29bf66a87bb56968b99
https://github.com/llvm-mirror/llvm/commit/e611018a3f1237c9328763027db4a616ed7be04a
-rw-r--r--src/rustllvm/PassWrapper.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
index 072a9144f17..e0a14f9b14f 100644
--- a/src/rustllvm/PassWrapper.cpp
+++ b/src/rustllvm/PassWrapper.cpp
@@ -969,11 +969,19 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
   // linkage will stay as external, and internal will stay as internal.
   std::set<GlobalValue::GUID> ExportedGUIDs;
   for (auto &List : Ret->Index) {
+#if LLVM_VERSION_GE(5, 0)
+    for (auto &GVS: List.second.SummaryList) {
+#else
     for (auto &GVS: List.second) {
+#endif
       if (GlobalValue::isLocalLinkage(GVS->linkage()))
         continue;
       auto GUID = GVS->getOriginalName();
+#if LLVM_VERSION_GE(5, 0)
+      if (GVS->flags().Live)
+#else
       if (!DeadSymbols.count(GUID))
+#endif
         ExportedGUIDs.insert(GUID);
     }
   }