about summary refs log tree commit diff
diff options
context:
space:
mode:
-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);
     }
   }