[PM] Add a utility pass template that synthesizes the invalidation of
[oota-llvm.git] / tools / yaml2obj / yaml2obj.cpp
index 945fad1384aa9756a68d410e9ec494c4079967d5..375cd89849c302a52e0d577334a4c3f5a22586d2 100644 (file)
@@ -83,11 +83,11 @@ int main(int argc, char **argv) {
   if (OutputFilename.empty())
     OutputFilename = "-";
 
-  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;
   }