From 3fd1e9933f4bb621ab6706b598830ff125fefe50 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. llvm-svn: 216393 --- llvm/lib/Bitcode/Writer/BitWriter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Bitcode') diff --git a/llvm/lib/Bitcode/Writer/BitWriter.cpp b/llvm/lib/Bitcode/Writer/BitWriter.cpp index 3747122fc98..6c9f7b3276f 100644 --- a/llvm/lib/Bitcode/Writer/BitWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitWriter.cpp @@ -18,10 +18,10 @@ using namespace llvm; /*===-- Operations on modules ---------------------------------------------===*/ int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path) { - std::string ErrorInfo; - raw_fd_ostream OS(Path, ErrorInfo, sys::fs::F_None); + std::error_code EC; + raw_fd_ostream OS(Path, EC, sys::fs::F_None); - if (!ErrorInfo.empty()) + if (EC) return -1; WriteBitcodeToFile(unwrap(M), OS); -- cgit v1.2.3