[PATCH] D37266: [ThinLTO] Clean up stale alias import handling
Teresa Johnson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 29 11:19:02 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL312019: [ThinLTO] Clean up stale alias import handling (authored by tejohnson).
Repository:
rL LLVM
https://reviews.llvm.org/D37266
Files:
llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp
Index: llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp
+++ llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp
@@ -727,41 +727,13 @@
}
}
for (GlobalAlias &GA : SrcModule->aliases()) {
- // FIXME: This should eventually be controlled entirely by the summary.
- if (FunctionImportGlobalProcessing::doImportAsDefinition(
- &GA, &GlobalsToImport)) {
- GlobalsToImport.insert(&GA);
- continue;
- }
-
if (!GA.hasName())
continue;
auto GUID = GA.getGUID();
- auto Import = ImportGUIDs.count(GUID);
- DEBUG(dbgs() << (Import ? "Is" : "Not") << " importing alias " << GUID
+ assert(!ImportGUIDs.count(GUID) && "Unexpected alias in import list");
+ DEBUG(dbgs() << "Not importing alias " << GUID
<< " " << GA.getName() << " from "
<< SrcModule->getSourceFileName() << "\n");
- if (Import) {
- // Alias can't point to "available_externally". However when we import
- // linkOnceODR the linkage does not change. So we import the alias
- // and aliasee only in this case. This has been handled by
- // computeImportForFunction()
- GlobalObject *GO = GA.getBaseObject();
- assert(GO->hasLinkOnceODRLinkage() &&
- "Unexpected alias to a non-linkonceODR in import list");
-#ifndef NDEBUG
- if (!GlobalsToImport.count(GO))
- DEBUG(dbgs() << " alias triggers importing aliasee " << GO->getGUID()
- << " " << GO->getName() << " from "
- << SrcModule->getSourceFileName() << "\n");
-#endif
- if (Error Err = GO->materialize())
- return std::move(Err);
- GlobalsToImport.insert(GO);
- if (Error Err = GA.materialize())
- return std::move(Err);
- GlobalsToImport.insert(&GA);
- }
}
// Upgrade debug info after we're done materializing all the globals and we
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37266.113124.patch
Type: text/x-patch
Size: 2081 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170829/20ee95bc/attachment.bin>
More information about the llvm-commits
mailing list