mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +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:
+10
-10
@@ -56,11 +56,11 @@ static int createDependencyFile(const TGParser &Parser, const char *argv0) {
|
||||
errs() << argv0 << ": the option -d must be used together with -o\n";
|
||||
return 1;
|
||||
}
|
||||
std::string Error;
|
||||
tool_output_file DepOut(DependFilename.c_str(), Error, sys::fs::F_Text);
|
||||
if (!Error.empty()) {
|
||||
errs() << argv0 << ": error opening " << DependFilename
|
||||
<< ":" << Error << "\n";
|
||||
std::error_code EC;
|
||||
tool_output_file DepOut(DependFilename, EC, sys::fs::F_Text);
|
||||
if (EC) {
|
||||
errs() << argv0 << ": error opening " << DependFilename << ":"
|
||||
<< EC.message() << "\n";
|
||||
return 1;
|
||||
}
|
||||
DepOut.os() << OutputFilename << ":";
|
||||
@@ -101,11 +101,11 @@ int TableGenMain(char *argv0, TableGenMainFn *MainFn) {
|
||||
if (Parser.ParseFile())
|
||||
return 1;
|
||||
|
||||
std::string Error;
|
||||
tool_output_file Out(OutputFilename.c_str(), Error, sys::fs::F_Text);
|
||||
if (!Error.empty()) {
|
||||
errs() << argv0 << ": error opening " << OutputFilename
|
||||
<< ":" << Error << "\n";
|
||||
std::error_code EC;
|
||||
tool_output_file Out(OutputFilename, EC, sys::fs::F_Text);
|
||||
if (EC) {
|
||||
errs() << argv0 << ": error opening " << OutputFilename << ":"
|
||||
<< EC.message() << "\n";
|
||||
return 1;
|
||||
}
|
||||
if (!DependFilename.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user