Modernize raw_fd_ostream's constructor a bit.
[oota-llvm.git] / tools / llvm-dis / llvm-dis.cpp
index 3b0f838f1d73b16285a79585bedb22ef75db7d13..fb73717376165f31975bb5f6f493c9ac487eb0c4 100644 (file)
@@ -171,11 +171,11 @@ int main(int argc, char **argv) {
     }
   }
 
-  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';
     return 1;
   }