Limit internalization in LLVM 8 ThinLTO

This commit is contained in:
Josh Stone 2019-04-26 08:58:14 -07:00
parent bd31c392f2
commit b4131e297e

View file

@ -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