From 8c968628473c7de416e3f468fead20023f33107e Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 25 Aug 2014 18:16:47 +0000 Subject: 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 --- tools/llvm-as/llvm-as.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/llvm-as') 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 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); } -- cgit v1.2.3