mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216393 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -66,15 +66,15 @@ static bool writeProgramToFileAux(tool_output_file &Out, const Module *M) {
|
||||
|
||||
bool BugDriver::writeProgramToFile(const std::string &Filename, int FD,
|
||||
const Module *M) const {
|
||||
tool_output_file Out(Filename.c_str(), FD);
|
||||
tool_output_file Out(Filename, FD);
|
||||
return writeProgramToFileAux(Out, M);
|
||||
}
|
||||
|
||||
bool BugDriver::writeProgramToFile(const std::string &Filename,
|
||||
const Module *M) const {
|
||||
std::string ErrInfo;
|
||||
tool_output_file Out(Filename.c_str(), ErrInfo, sys::fs::F_None);
|
||||
if (ErrInfo.empty())
|
||||
std::error_code EC;
|
||||
tool_output_file Out(Filename, EC, sys::fs::F_None);
|
||||
if (!EC)
|
||||
return writeProgramToFileAux(Out, M);
|
||||
return true;
|
||||
}
|
||||
@@ -149,7 +149,7 @@ bool BugDriver::runPasses(Module *Program,
|
||||
return 1;
|
||||
}
|
||||
|
||||
tool_output_file InFile(InputFilename.c_str(), InputFD);
|
||||
tool_output_file InFile(InputFilename, InputFD);
|
||||
|
||||
WriteBitcodeToFile(Program, InFile.os());
|
||||
InFile.os().close();
|
||||
|
||||
Reference in New Issue
Block a user