diff options
| author | Josh Stone <jistone@redhat.com> | 2019-04-26 08:58:14 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2019-04-26 08:58:14 -0700 |
| commit | b4131e297e18fde119f6f461b3e622218166b009 (patch) | |
| tree | 493ba59c731fdcc56615567fd5d8c8de1cfd42a5 /src/rustllvm/PassWrapper.cpp | |
| parent | bd31c392f286d61caac0babee68c900cdaa8b504 (diff) | |
| download | rust-b4131e297e18fde119f6f461b3e622218166b009.tar.gz rust-b4131e297e18fde119f6f461b3e622218166b009.zip | |
Limit internalization in LLVM 8 ThinLTO
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
| -rw-r--r-- | src/rustllvm/PassWrapper.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 319c66a21f1..0ebef82d376 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -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 |
