Fix bitcode auto-upgrade when using bitcode lazy loading

The auto-upgrade path could be called before the VST (global
names) was fully parsed, and thus intrinsic names were not
available and the autoupgrade logic could not operate.

Fix link failures with ThinLTO.

This is a recommit of r278610 with a different fix.

llvm-svn: 278615
This commit is contained in:
Mehdi Amini
2016-08-14 00:01:27 +00:00
parent 822ee88ab8
commit a71002e7f1
3 changed files with 26 additions and 1 deletions

View File

@@ -3682,7 +3682,9 @@ std::error_code BitcodeReader::parseModule(uint64_t ResumeBit,
// have been seen yet. In this case, just finish the parse now.
if (SeenValueSymbolTable) {
NextUnreadBit = Stream.GetCurrentBitNo();
return std::error_code();
// After the VST has been parsed, we need to make sure intrinsic name
// are auto-upgraded.
return globalCleanup();
}
break;
case bitc::USELIST_BLOCK_ID: