Modernize the error handling of the Materialize function.
[oota-llvm.git] / lib / IR / Module.cpp
index f43080b72eed315b6b8cc77b16cfba07d4757b7c..e35eefbd45c5fce1173a6f0e2c340613a16e62a8 100644 (file)
@@ -395,16 +395,11 @@ bool Module::isDematerializable(const GlobalValue *GV) const {
   return false;
 }
 
-bool Module::Materialize(GlobalValue *GV, std::string *ErrInfo) {
+std::error_code Module::materialize(GlobalValue *GV) {
   if (!Materializer)
-    return false;
-
-  std::error_code EC = Materializer->Materialize(GV);
-  if (!EC)
-    return false;
-  if (ErrInfo)
-    *ErrInfo = EC.message();
-  return true;
+    return std::error_code();
+
+  return Materializer->materialize(GV);
 }
 
 void Module::Dematerialize(GlobalValue *GV) {