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
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user