Modernize raw_fd_ostream's constructor a bit.
[oota-llvm.git] / tools / llvm-link / llvm-link.cpp
index a756a1c33a2e5748db68a4b70cae6b603cbd471d..9e217201a7250c87b12da4533dad54128b7bd371 100644 (file)
@@ -19,6 +19,7 @@
 #include "llvm/IR/Verifier.h"
 #include "llvm/IRReader/IRReader.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/FileSystem.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/PrettyStackTrace.h"
@@ -109,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;
   }