about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-12-08 08:48:02 +0000
committerbors <bors@rust-lang.org>2017-12-08 08:48:02 +0000
commit58a05eed54dc737249a07bc50282d9db831d03b9 (patch)
treeb3afaf2b9e1b0695690b6025ff72615661c03c1d /src/rustllvm/PassWrapper.cpp
parent5f4b09ee480aab38e466700563e2a6276f9a73e7 (diff)
parent17fb43bdc61481ff754fe53e8e8fa589fb8789ee (diff)
downloadrust-58a05eed54dc737249a07bc50282d9db831d03b9.tar.gz
rust-58a05eed54dc737249a07bc50282d9db831d03b9.zip
Auto merge of #46549 - alexcrichton:thinlto-weak, r=michaelwoerister
rustc: Further tweak linkage in ThinLTO

In #46382 the logic around linkage preservation with ThinLTO ws tweaked but the
loop that registered all otherwise exported GUID values as "don't internalize
me please" was erroneously too conservative and only asking "external" linkage
items to not be internalized. Instead we actually want the inversion of that
condition, everything *without* "local" linkage to be internalized.

This commit updates the condition there, adds a test, and...

Closes #46543
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
-rw-r--r--src/rustllvm/PassWrapper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
index 1797e19c549..072a9144f17 100644
--- a/src/rustllvm/PassWrapper.cpp
+++ b/src/rustllvm/PassWrapper.cpp
@@ -970,7 +970,7 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
   std::set<GlobalValue::GUID> ExportedGUIDs;
   for (auto &List : Ret->Index) {
     for (auto &GVS: List.second) {
-      if (!GlobalValue::isExternalLinkage(GVS->linkage()))
+      if (GlobalValue::isLocalLinkage(GVS->linkage()))
         continue;
       auto GUID = GVS->getOriginalName();
       if (!DeadSymbols.count(GUID))