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/lib/Bitcode/Writer | |
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/lib/Bitcode/Writer')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitWriter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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); |