Skip to content

Commit

Permalink
Auto merge of #60313 - cuviper:thinlto-import, r=alexcrichton
Browse files Browse the repository at this point in the history
Limit internalization in LLVM 8 ThinLTO

Fixes #60184.
r? @alexcrichton
  • Loading branch information
bors committed Apr 27, 2019
2 parents a9c8c08 + b4131e2 commit 938d4ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rustllvm/PassWrapper.cpp
Expand Up @@ -873,8 +873,11 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
return PrevailingType::Unknown;
};
#if LLVM_VERSION_GE(8, 0)
// We don't have a complete picture in our use of ThinLTO, just our immediate
// crate, so we need `ImportEnabled = false` to limit internalization.
// Otherwise, we sometimes lose `static` values -- see #60184.
computeDeadSymbolsWithConstProp(Ret->Index, Ret->GUIDPreservedSymbols,
deadIsPrevailing, /* ImportEnabled = */ true);
deadIsPrevailing, /* ImportEnabled = */ false);
#else
computeDeadSymbols(Ret->Index, Ret->GUIDPreservedSymbols, deadIsPrevailing);
#endif
Expand Down

0 comments on commit 938d4ff

Please sign in to comment.