Modernize raw_fd_ostream's constructor a bit.
[oota-llvm.git] / tools / llvm-as / llvm-as.cpp
index ef4f7ba272a352b5d2d57f9e1b8e7ae3b956d2bc..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);
   }