Modernize raw_fd_ostream's constructor a bit.
[oota-llvm.git] / tools / llvm-link / llvm-link.cpp
index ed8c06e79843965a082f8d216b6d77899b1c238d..9e217201a7250c87b12da4533dad54128b7bd371 100644 (file)
@@ -110,10 +110,10 @@ int main(int argc, char **argv) {
 
   if (DumpAsm) errs() << "Here's the assembly:\n" << *Composite;
 
-  std::string ErrorInfo;
-  tool_output_file Out(OutputFilename.c_str(), ErrorInfo, sys::fs::F_None);
-  if (!ErrorInfo.empty()) {
-    errs() << ErrorInfo << '\n';
+  std::error_code EC;
+  tool_output_file Out(OutputFilename, EC, sys::fs::F_None);
+  if (EC) {
+    errs() << EC.message() << '\n';
     return 1;
   }