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/Transforms | |
| 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/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/DebugIR.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/DebugIR.cpp b/llvm/lib/Transforms/Instrumentation/DebugIR.cpp index f416339c6ad..5234341b32e 100644 --- a/llvm/lib/Transforms/Instrumentation/DebugIR.cpp +++ b/llvm/lib/Transforms/Instrumentation/DebugIR.cpp @@ -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 { diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp index cfeb62eb1f9..a1f42a8c3a4 100644 --- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -480,9 +480,8 @@ void GCOVProfiler::emitProfileNotes() { // LTO, we'll generate the same .gcno files. DICompileUnit CU(CU_Nodes->getOperand(i)); - std::string ErrorInfo; - raw_fd_ostream out(mangleName(CU, "gcno").c_str(), ErrorInfo, - sys::fs::F_None); + std::error_code EC; + raw_fd_ostream out(mangleName(CU, "gcno"), EC, sys::fs::F_None); std::string EdgeDestinations; DIArray SPs = CU.getSubprograms(); |

