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

This is a recommit of r265095 after fixing the Windows issues.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265111 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mehdi Amini
2016-04-01 05:33:11 +00:00
parent d4b1021e3e
commit d2f4701e4a
12 changed files with 236 additions and 38 deletions
+5 -3
View File
@@ -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");