parent
830599b195
commit
dffa36c005
1 changed files with 8 additions and 0 deletions
|
@ -969,11 +969,19 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
|
||||||
// linkage will stay as external, and internal will stay as internal.
|
// linkage will stay as external, and internal will stay as internal.
|
||||||
std::set<GlobalValue::GUID> ExportedGUIDs;
|
std::set<GlobalValue::GUID> ExportedGUIDs;
|
||||||
for (auto &List : Ret->Index) {
|
for (auto &List : Ret->Index) {
|
||||||
|
#if LLVM_VERSION_GE(5, 0)
|
||||||
|
for (auto &GVS: List.second.SummaryList) {
|
||||||
|
#else
|
||||||
for (auto &GVS: List.second) {
|
for (auto &GVS: List.second) {
|
||||||
|
#endif
|
||||||
if (GlobalValue::isLocalLinkage(GVS->linkage()))
|
if (GlobalValue::isLocalLinkage(GVS->linkage()))
|
||||||
continue;
|
continue;
|
||||||
auto GUID = GVS->getOriginalName();
|
auto GUID = GVS->getOriginalName();
|
||||||
|
#if LLVM_VERSION_GE(5, 0)
|
||||||
|
if (GVS->flags().Live)
|
||||||
|
#else
|
||||||
if (!DeadSymbols.count(GUID))
|
if (!DeadSymbols.count(GUID))
|
||||||
|
#endif
|
||||||
ExportedGUIDs.insert(GUID);
|
ExportedGUIDs.insert(GUID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue