ThinLTO: handles modules with empty summaries

We need to add an entry in the combined-index for modules that have
a hash but otherwise empty summary, this is needed so that we can
get the hash for the module.

Also, if no entry is present in the combined index for a module, we
need to skip it when trying to compute a cache entry.

Differential Revision: https://reviews.llvm.org/D25300

llvm-svn: 283654
This commit is contained in:
Mehdi Amini
2016-10-08 04:44:18 +00:00
parent 01e0e136bd
commit 00fa1409ec
7 changed files with 66 additions and 16 deletions

View File

@@ -6147,8 +6147,8 @@ std::error_code ModuleSummaryIndexBitcodeReader::parseModule() {
if (!TheIndex)
break;
if (TheIndex->modulePaths().empty())
// Does not have any summary emitted.
break;
// We always seed the index with the module.
TheIndex->addModulePath(Buffer->getBufferIdentifier(), 0);
if (TheIndex->modulePaths().size() != 1)
return error("Don't expect multiple modules defined?");
auto &Hash = TheIndex->modulePaths().begin()->second.second;