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 | 8c968628473c7de416e3f468fead20023f33107e (patch) | |
tree | 81280e5bc1d0376271b6ad18e1e2b4876c5d1725 /tools/llvm-as | |
parent | a4c8f31dd0ba2916888b29e87bc26e263d6adeaf (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216393 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-as')
-rw-r--r-- | tools/llvm-as/llvm-as.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/llvm-as/llvm-as.cpp b/tools/llvm-as/llvm-as.cpp index ef4f7ba272a..5ccf505923f 100644 --- a/tools/llvm-as/llvm-as.cpp +++ b/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); } |