Modernize raw_fd_ostream's constructor a bit.
[oota-llvm.git] / lib / Bitcode / Writer / BitWriter.cpp
index 3747122fc98f5e706bf1549597c9f6f3372c4985..6c9f7b3276fdaa883c6413c26d697ade7075d1a9 100644 (file)
@@ -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);