diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/IR/FunctionInfo.cpp | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 9d907773cb3..11c9b131da7 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -5566,12 +5566,14 @@ std::error_code FunctionIndexBitcodeReader::parseModule() { case BitstreamEntry::SubBlock: if (CheckFuncSummaryPresenceOnly) { - if (Entry.ID == bitc::FUNCTION_SUMMARY_BLOCK_ID) + if (Entry.ID == bitc::FUNCTION_SUMMARY_BLOCK_ID) { SeenFuncSummary = true; + // No need to parse the rest since we found the summary. + return std::error_code(); + } if (Stream.SkipBlock()) return error("Invalid record"); - // No need to parse the rest since we found the summary. - return std::error_code(); + continue; } switch (Entry.ID) { default: // Skip unknown content. diff --git a/llvm/lib/IR/FunctionInfo.cpp b/llvm/lib/IR/FunctionInfo.cpp index d26c7a4e9a0..17a67bcf047 100644 --- a/llvm/lib/IR/FunctionInfo.cpp +++ b/llvm/lib/IR/FunctionInfo.cpp @@ -31,6 +31,10 @@ void FunctionInfoIndex::mergeFrom(std::unique_ptr<FunctionInfoIndex> Other, assert(List.size() == 1); std::unique_ptr<FunctionInfo> Info = std::move(List.front()); + // Skip if there was no function summary section. + if (!Info->functionSummary()) + continue; + // Add the module path string ref for this module if we haven't already // saved a reference to it. if (ModPath.empty()) |