diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-01 01:30:06 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-01 01:30:06 +0000 |
commit | 4c2ed3337dd36ad421a97b8629ffa7ed963e0af3 (patch) | |
tree | ebaa34e66807222ea19b3e4e86bde69f5dee6ba6 /llvm/lib/IR/ModuleSummaryIndex.cpp | |
parent | 3689ae14ebebc495bab476461afc61b1bb3c72f7 (diff) | |
download | bcm5719-llvm-4c2ed3337dd36ad421a97b8629ffa7ed963e0af3.tar.gz bcm5719-llvm-4c2ed3337dd36ad421a97b8629ffa7ed963e0af3.zip |
Add a module Hash in the bitcode and the combined index, implementing a kind of "build-id"
This is intended to be used for ThinLTO incremental build.
Differential Revision: http://reviews.llvm.org/D18213
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 265095
Diffstat (limited to 'llvm/lib/IR/ModuleSummaryIndex.cpp')
-rw-r--r-- | llvm/lib/IR/ModuleSummaryIndex.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp index 16b58ddbeff..c23e072b48a 100644 --- a/llvm/lib/IR/ModuleSummaryIndex.cpp +++ b/llvm/lib/IR/ModuleSummaryIndex.cpp @@ -37,9 +37,11 @@ void ModuleSummaryIndex::mergeFrom(std::unique_ptr<ModuleSummaryIndex> Other, // Add the module path string ref for this module if we haven't already // saved a reference to it. - if (ModPath.empty()) - ModPath = addModulePath(Info->summary()->modulePath(), NextModuleId); - else + if (ModPath.empty()) { + auto Path = Info->summary()->modulePath(); + ModPath = addModulePath(Path, NextModuleId, Other->getModuleHash(Path)) + ->first(); + } else assert(ModPath == Info->summary()->modulePath() && "Each module in the combined map should have a unique ID"); |