Fix a bug in the conversion to ErrorOr.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 4 Jul 2014 20:05:56 +0000 (20:05 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 4 Jul 2014 20:05:56 +0000 (20:05 +0000)
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

lib/Bitcode/Reader/BitcodeReader.cpp

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