Modernize raw_fd_ostream's constructor a bit.
[oota-llvm.git] / tools / llvm-mc / llvm-mc.cpp
index 42cde6e16f4c0d191d059922acc224c95490508e..61d1d9960d028491ccaa9bab4a3848b375318324 100644 (file)
@@ -208,11 +208,11 @@ static tool_output_file *GetOutputStream() {
   if (OutputFilename == "")
     OutputFilename = "-";
 
-  std::string Err;
+  std::error_code EC;
   tool_output_file *Out =
-      new tool_output_file(OutputFilename.c_str(), Err, sys::fs::F_None);
-  if (!Err.empty()) {
-    errs() << Err << '\n';
+      new tool_output_file(OutputFilename, EC, sys::fs::F_None);
+  if (EC) {
+    errs() << EC.message() << '\n';
     delete Out;
     return nullptr;
   }