[llvm] r212357 - Fix a bug in the conversion to ErrorOr.

Rafael Espindola rafael.espindola at gmail.com
Fri Jul 4 13:05:56 PDT 2014


Author: rafael
Date: Fri Jul  4 15:05:56 2014
New Revision: 212357

URL: http://llvm.org/viewvc/llvm-project?rev=212357&view=rev
Log:
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).

Modified:
    llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp

Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=212357&r1=212356&r2=212357&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Fri Jul  4 15:05:56 2014
@@ -2132,7 +2132,7 @@ ErrorOr<std::string> BitcodeReader::pars
     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::pars
     }
     Record.clear();
   }
-  return Triple;
+  llvm_unreachable("Exit infinite loop");
 }
 
 ErrorOr<std::string> BitcodeReader::parseTriple() {





More information about the llvm-commits mailing list