diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-25 18:16:47 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-25 18:16:47 +0000 |
commit | 3fd1e9933f4bb621ab6706b598830ff125fefe50 (patch) | |
tree | 4db6ed12f77a315b32b45962461944b0fbf2dfe5 /llvm/tools/llvm-as/llvm-as.cpp | |
parent | b709222b8a579a121444485efaa71ea6944eda1d (diff) | |
download | bcm5719-llvm-3fd1e9933f4bb621ab6706b598830ff125fefe50.tar.gz bcm5719-llvm-3fd1e9933f4bb621ab6706b598830ff125fefe50.zip |
Modernize raw_fd_ostream's constructor a bit.
Take a StringRef instead of a "const char *".
Take a "std::error_code &" instead of a "std::string &" for error.
A create static method would be even better, but this patch is already a bit too
big.
llvm-svn: 216393
Diffstat (limited to 'llvm/tools/llvm-as/llvm-as.cpp')
-rw-r--r-- | llvm/tools/llvm-as/llvm-as.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/tools/llvm-as/llvm-as.cpp b/llvm/tools/llvm-as/llvm-as.cpp index ef4f7ba272a..5ccf505923f 100644 --- a/llvm/tools/llvm-as/llvm-as.cpp +++ b/llvm/tools/llvm-as/llvm-as.cpp @@ -69,11 +69,11 @@ static void WriteOutputFile(const Module *M) { } } - 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'; exit(1); } |