summaryrefslogtreecommitdiff
path: root/tools/llvm-lto
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-05-01 22:04:36 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-05-01 22:04:36 +0000
commit10dbf12dd665bf7aaf67526cff2b18e396e58a6c (patch)
tree687266968cb96e3ee8af3abc2c23f860e44df0db /tools/llvm-lto
parent4d051558e484ab270d87635842802c6cecb6212c (diff)
Bitcode: Make the summary reader responsible for merging. NFCI.
This is to prepare for an upcoming change which uses pointers instead of GUIDs to represent references. Differential Revision: https://reviews.llvm.org/D32469 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301843 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-lto')
-rw-r--r--tools/llvm-lto/llvm-lto.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/llvm-lto/llvm-lto.cpp b/tools/llvm-lto/llvm-lto.cpp
index 86cdf9b6b3e..27e5c5e122c 100644
--- a/tools/llvm-lto/llvm-lto.cpp
+++ b/tools/llvm-lto/llvm-lto.cpp
@@ -331,12 +331,9 @@ static void createCombinedModuleSummaryIndex() {
uint64_t NextModuleId = 0;
for (auto &Filename : InputFilenames) {
ExitOnError ExitOnErr("llvm-lto: error loading file '" + Filename + "': ");
- std::unique_ptr<ModuleSummaryIndex> Index =
- ExitOnErr(llvm::getModuleSummaryIndexForFile(Filename));
- // Skip files without a module summary.
- if (!Index)
- continue;
- CombinedIndex.mergeFrom(std::move(Index), ++NextModuleId);
+ std::unique_ptr<MemoryBuffer> MB =
+ ExitOnErr(errorOrToExpected(MemoryBuffer::getFileOrSTDIN(Filename)));
+ ExitOnErr(readModuleSummaryIndex(*MB, CombinedIndex, ++NextModuleId));
}
std::error_code EC;
assert(!OutputFilename.empty());