gold-plugin.cpp: Fixup r227599 corresponding to r227685 and r227731 -- Don't lose...
[oota-llvm.git] / tools / llvm-as / llvm-as.cpp
index 007241c5068dd724960805bdc2f50406e9ebabfd..5ccf505923f2d7f19071613a0aea45cade34b8e6 100644 (file)
@@ -69,11 +69,11 @@ static void WriteOutputFile(const Module *M) {
     }
   }
 
-  std::string ErrorInfo;
+  std::error_code EC;
   std::unique_ptr<tool_output_file> Out(
-      new tool_output_file(OutputFilename.c_str(), ErrorInfo, sys::fs::F_None));
-  if (!ErrorInfo.empty()) {
-    errs() << ErrorInfo << '\n';
+      new tool_output_file(OutputFilename, EC, sys::fs::F_None));
+  if (EC) {
+    errs() << EC.message() << '\n';
     exit(1);
   }
 
@@ -94,7 +94,7 @@ int main(int argc, char **argv) {
 
   // Parse the file now...
   SMDiagnostic Err;
-  std::unique_ptr<Module> M(ParseAssemblyFile(InputFilename, Err, Context));
+  std::unique_ptr<Module> M = parseAssemblyFile(InputFilename, Err, Context);
   if (!M.get()) {
     Err.print(argv[0], errs());
     return 1;