[InstCombine] Re-commit of r218721 (Optimize icmp-select-icmp sequence)
[oota-llvm.git] / lib / IR / LegacyPassManager.cpp
index 5ba08575134a4ba418357c5ffa35bdc830e49d88..28fa74cbfda93973d242217ffcccc4baf25c9fac 100644 (file)
@@ -1403,11 +1403,8 @@ void FunctionPassManager::add(Pass *P) {
 /// so, return true.
 ///
 bool FunctionPassManager::run(Function &F) {
-  if (F.isMaterializable()) {
-    std::string errstr;
-    if (F.Materialize(&errstr))
-      report_fatal_error("Error reading bitcode file: " + Twine(errstr));
-  }
+  if (std::error_code EC = F.materialize())
+    report_fatal_error("Error reading bitcode file: " + EC.message());
   return FPM->run(F);
 }