[PATCH] D40748: [ThinLTO] Enable importing of aliases as copy of aliasee
Teresa Johnson via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 1 13:04:20 PST 2017
tejohnson created this revision.
Herald added a subscriber: inglorion.
Clang side changes to go with LLVM change to import aliases as
a copy of their aliasee. Simply refactor out some handling that
is moved to LLVM for use elsewhere.
Depends on https://reviews.llvm.org/D40747.
Repository:
rC Clang
https://reviews.llvm.org/D40748
Files:
lib/CodeGen/BackendUtil.cpp
Index: lib/CodeGen/BackendUtil.cpp
===================================================================
--- lib/CodeGen/BackendUtil.cpp
+++ lib/CodeGen/BackendUtil.cpp
@@ -1038,23 +1038,8 @@
// we should only invoke this using the individual indexes written out
// via a WriteIndexesThinBackend.
FunctionImporter::ImportMapTy ImportList;
- for (auto &GlobalList : *CombinedIndex) {
- // Ignore entries for undefined references.
- if (GlobalList.second.SummaryList.empty())
- continue;
-
- auto GUID = GlobalList.first;
- assert(GlobalList.second.SummaryList.size() == 1 &&
- "Expected individual combined index to have one summary per GUID");
- auto &Summary = GlobalList.second.SummaryList[0];
- // Skip the summaries for the importing module. These are included to
- // e.g. record required linkage changes.
- if (Summary->modulePath() == M->getModuleIdentifier())
- continue;
- // Doesn't matter what value we plug in to the map, just needs an entry
- // to provoke importing by thinBackend.
- ImportList[Summary->modulePath()][GUID] = 1;
- }
+ llvm::ComputeCrossModuleImportForModuleFromIndex(M->getModuleIdentifier(),
+ *CombinedIndex, ImportList);
std::vector<std::unique_ptr<llvm::MemoryBuffer>> OwnedImports;
MapVector<llvm::StringRef, llvm::BitcodeModule> ModuleMap;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40748.125203.patch
Type: text/x-patch
Size: 1398 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171201/b3f62fa0/attachment.bin>
More information about the cfe-commits
mailing list