Return an error_code from materializeAllPermanently.

llvm-svn: 199275
This commit is contained in:
Rafael Espindola committed 2014-01-14 23:51:27 +00:00
1 parent 4dcc4637b5
commit e9fab9b077
7 files changed
+25 -21

No files matched your search

+3 -1
View File
@@ -3359,7 +3359,9 @@ Module *llvm::ParseBitcodeFile(MemoryBuffer *Buffer, LLVMContext& Context,
static_cast<BitcodeReader*>(M->getMaterializer())->setBufferOwned(false);
// Read in the entire module, and destroy the BitcodeReader.
if (M->MaterializeAllPermanently(ErrMsg)) {
if (error_code EC = M->materializeAllPermanently()) {
if (ErrMsg)
*ErrMsg = EC.message();
delete M;
return 0;
}