forked from OSchip/llvm-project
parent
0941b568ce
commit
b14bd53e6d
|
@ -245,11 +245,10 @@ bool writeFiles(const clang::Rewriter &Rewrites) {
|
|||
const char *FileName =
|
||||
Rewrites.getSourceMgr().getFileEntryForID(BufferI->first)->getName();
|
||||
|
||||
std::string ErrorInfo;
|
||||
|
||||
llvm::raw_fd_ostream FileStream(FileName, ErrorInfo, llvm::sys::fs::F_Text);
|
||||
if (!ErrorInfo.empty()) {
|
||||
errs() << "Warning: Could not write to " << FileName << "\n";
|
||||
std::error_code EC;
|
||||
llvm::raw_fd_ostream FileStream(FileName, EC, llvm::sys::fs::F_Text);
|
||||
if (EC) {
|
||||
errs() << "Warning: Could not write to " << EC.message() << "\n";
|
||||
continue;
|
||||
}
|
||||
BufferI->second.write(FileStream);
|
||||
|
|
|
@ -271,10 +271,9 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
// Write new file to disk
|
||||
std::string ErrorInfo;
|
||||
llvm::raw_fd_ostream FileStream(I->getKey().str().c_str(), ErrorInfo,
|
||||
llvm::sys::fs::F_Text);
|
||||
if (!ErrorInfo.empty()) {
|
||||
std::error_code EC;
|
||||
llvm::raw_fd_ostream FileStream(I->getKey(), EC, llvm::sys::fs::F_Text);
|
||||
if (EC) {
|
||||
llvm::errs() << "Could not open " << I->getKey() << " for writing\n";
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -50,9 +50,8 @@ void writePerfDataJSON(
|
|||
SS << DirectoryName << "/" << static_cast<int>(T.getWallTime()) << "_" << Pid
|
||||
<< ".json";
|
||||
|
||||
std::string ErrorInfo;
|
||||
llvm::raw_fd_ostream FileStream(SS.str().c_str(), ErrorInfo,
|
||||
llvm::sys::fs::F_Text);
|
||||
std::error_code EC;
|
||||
llvm::raw_fd_ostream FileStream(SS.str(), EC, llvm::sys::fs::F_Text);
|
||||
FileStream << "{\n";
|
||||
FileStream << " \"Sources\" : [\n";
|
||||
for (SourcePerfData::const_iterator I = TimingResults.begin(),
|
||||
|
|
|
@ -72,11 +72,10 @@ bool ReplacementHandling::serializeReplacements(
|
|||
continue;
|
||||
}
|
||||
|
||||
std::string ErrorInfo;
|
||||
raw_fd_ostream ReplacementsFile(ReplacementsFileName.c_str(), ErrorInfo,
|
||||
fs::F_None);
|
||||
if (!ErrorInfo.empty()) {
|
||||
errs() << "Error opening file: " << ErrorInfo << "\n";
|
||||
std::error_code EC;
|
||||
raw_fd_ostream ReplacementsFile(ReplacementsFileName, EC, fs::F_None);
|
||||
if (EC) {
|
||||
errs() << "Error opening file: " << EC.message() << "\n";
|
||||
Errors = true;
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -247,11 +247,11 @@ static bool writeModuleMap(llvm::StringRef ModuleMapPath,
|
|||
}
|
||||
|
||||
// Set up module map output file.
|
||||
std::string Error;
|
||||
llvm::tool_output_file Out(FilePath.c_str(), Error, llvm::sys::fs::F_Text);
|
||||
if (!Error.empty()) {
|
||||
llvm::errs() << Argv0 << ": error opening " << FilePath << ":" << Error
|
||||
<< "\n";
|
||||
std::error_code EC;
|
||||
llvm::tool_output_file Out(FilePath, EC, llvm::sys::fs::F_Text);
|
||||
if (EC) {
|
||||
llvm::errs() << Argv0 << ": error opening " << FilePath << ":"
|
||||
<< EC.message() << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -212,12 +212,11 @@ int main(int Argc, const char **Argv) {
|
|||
HadErrors = outputPPTrace(CallbackCalls, llvm::outs());
|
||||
} else {
|
||||
// Set up output file.
|
||||
std::string Error;
|
||||
llvm::tool_output_file Out(OutputFileName.c_str(), Error,
|
||||
llvm::sys::fs::F_Text);
|
||||
if (!Error.empty()) {
|
||||
std::error_code EC;
|
||||
llvm::tool_output_file Out(OutputFileName, EC, llvm::sys::fs::F_Text);
|
||||
if (EC) {
|
||||
llvm::errs() << "pp-trace: error creating " << OutputFileName << ":"
|
||||
<< Error << "\n";
|
||||
<< EC.message() << "\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue