Return an error_code from materializeAllPermanently.
[oota-llvm.git] / lib / ExecutionEngine / Interpreter / Interpreter.cpp
index 9ee9d9456d1d2afca744900eecf6c55d224a90e1..6d4f6f716fc4d06a374e1e8c362f34d54a9a9446 100644 (file)
@@ -34,9 +34,12 @@ extern "C" void LLVMLinkInInterpreter() { }
 ///
 ExecutionEngine *Interpreter::create(Module *M, std::string* ErrStr) {
   // Tell this Module to materialize everything and release the GVMaterializer.
-  if (M->MaterializeAllPermanently(ErrStr))
+  if (error_code EC = M->materializeAllPermanently()) {
+    if (ErrStr)
+      *ErrStr = EC.message();
     // We got an error, just return 0
     return 0;
+  }
 
   return new Interpreter(M);
 }