From 00fa1409ec8d8d6db8597fbe73eac65094e8b425 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sat, 8 Oct 2016 04:44:18 +0000 Subject: 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 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 101e8eba6b1..df9ab1c496c 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -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; -- cgit v1.2.3