Fix a bug in the conversion to ErrorOr.

The regular end of the bitcode parsing is in the  BitstreamEntry::EndBlock
case.

Should fix the LTO bootstrap on OS X (this function is only used by ld64).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212357 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-07-04 20:05:56 +00:00
parent c77a7749ff
commit 483d89bcd4

View File

@ -2132,7 +2132,7 @@ ErrorOr<std::string> BitcodeReader::parseModuleTriple() {
case BitstreamEntry::Error: case BitstreamEntry::Error:
return Error(MalformedBlock); return Error(MalformedBlock);
case BitstreamEntry::EndBlock: case BitstreamEntry::EndBlock:
return std::error_code(); return Triple;
case BitstreamEntry::Record: case BitstreamEntry::Record:
// The interesting case. // The interesting case.
break; break;
@ -2151,7 +2151,7 @@ ErrorOr<std::string> BitcodeReader::parseModuleTriple() {
} }
Record.clear(); Record.clear();
} }
return Triple; llvm_unreachable("Exit infinite loop");
} }
ErrorOr<std::string> BitcodeReader::parseTriple() { ErrorOr<std::string> BitcodeReader::parseTriple() {