Modernize raw_fd_ostream's constructor a bit.
[oota-llvm.git] / tools / llvm-lto / llvm-lto.cpp
index 8b39f1285f5fcd5702b7761387a90e16e2159644..2f19090dfc9384ac2d947eed66cb9f7915aa6577 100644 (file)
@@ -165,11 +165,11 @@ int main(int argc, char **argv) {
       return 1;
     }
 
-    raw_fd_ostream FileStream(OutputFilename.c_str(), ErrorInfo,
-                              sys::fs::F_None);
-    if (!ErrorInfo.empty()) {
+    std::error_code EC;
+    raw_fd_ostream FileStream(OutputFilename, EC, sys::fs::F_None);
+    if (EC) {
       errs() << argv[0] << ": error opening the file '" << OutputFilename
-             << "': " << ErrorInfo << "\n";
+             << "': " << EC.message() << "\n";
       return 1;
     }