Modernize raw_fd_ostream's constructor a bit.
[oota-llvm.git] / lib / Transforms / Instrumentation / DebugIR.cpp
index f416339c6ad329810f7aa95250272d907fb1ab99..5234341b32edc8a156fc16afe9af382890df0170 100644 (file)
@@ -525,11 +525,11 @@ std::string DebugIR::getPath() {
 
 void DebugIR::writeDebugBitcode(const Module *M, int *fd) {
   std::unique_ptr<raw_fd_ostream> Out;
-  std::string error;
+  std::error_code EC;
 
   if (!fd) {
     std::string Path = getPath();
-    Out.reset(new raw_fd_ostream(Path.c_str(), error, sys::fs::F_Text));
+    Out.reset(new raw_fd_ostream(Path, EC, sys::fs::F_Text));
     DEBUG(dbgs() << "WRITING debug bitcode from Module " << M << " to file "
                  << Path << "\n");
   } else {