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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278615 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mehdi Amini
2016-08-14 00:01:27 +00:00
parent 26d2a23314
commit 2c1c0b444f
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: