forked from OSchip/llvm-project
Update for raw_fd_ostream API changes. raw_fd_ostream now has a
Force flag to control whether the case of opening an existing file is considered an error. llvm-svn: 75802
This commit is contained in:
parent
607818a2c1
commit
74e3eb49ea
|
@ -149,7 +149,7 @@ void CXXRecordDecl::viewInheritance(ASTContext& Context) const {
|
||||||
|
|
||||||
llvm::errs() << "Writing '" << Filename.c_str() << "'... ";
|
llvm::errs() << "Writing '" << Filename.c_str() << "'... ";
|
||||||
|
|
||||||
llvm::raw_fd_ostream O(Filename.c_str(), false, ErrMsg);
|
llvm::raw_fd_ostream O(Filename.c_str(), false, /*Force=*/true, ErrMsg);
|
||||||
|
|
||||||
if (ErrMsg.empty()) {
|
if (ErrMsg.empty()) {
|
||||||
InheritanceHierarchyWriter Writer(Context, O);
|
InheritanceHierarchyWriter Writer(Context, O);
|
||||||
|
|
|
@ -587,7 +587,8 @@ static ExplodedNodeImpl::Auditor* CreateUbiViz() {
|
||||||
|
|
||||||
llvm::OwningPtr<llvm::raw_fd_ostream> Stream;
|
llvm::OwningPtr<llvm::raw_fd_ostream> Stream;
|
||||||
std::string filename = Filename.toString();
|
std::string filename = Filename.toString();
|
||||||
Stream.reset(new llvm::raw_fd_ostream(filename.c_str(), false, ErrMsg));
|
Stream.reset(new llvm::raw_fd_ostream(filename.c_str(), false,
|
||||||
|
/*Force=*/true, ErrMsg));
|
||||||
|
|
||||||
if (!ErrMsg.empty())
|
if (!ErrMsg.empty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -47,6 +47,7 @@ bool FixItRewriter::WriteFixedFile(const std::string &InFileName,
|
||||||
OutFile = new llvm::raw_fd_ostream(OutFileName.c_str(),
|
OutFile = new llvm::raw_fd_ostream(OutFileName.c_str(),
|
||||||
// set binary mode (critical for Windoze)
|
// set binary mode (critical for Windoze)
|
||||||
true,
|
true,
|
||||||
|
/*Force=*/true,
|
||||||
Err);
|
Err);
|
||||||
OwnedStream.reset(OutFile);
|
OwnedStream.reset(OutFile);
|
||||||
} else if (InFileName == "-") {
|
} else if (InFileName == "-") {
|
||||||
|
@ -60,6 +61,7 @@ bool FixItRewriter::WriteFixedFile(const std::string &InFileName,
|
||||||
OutFile = new llvm::raw_fd_ostream(Path.toString().c_str(),
|
OutFile = new llvm::raw_fd_ostream(Path.toString().c_str(),
|
||||||
// set binary mode (critical for Windoze)
|
// set binary mode (critical for Windoze)
|
||||||
true,
|
true,
|
||||||
|
/*Force=*/true,
|
||||||
Err);
|
Err);
|
||||||
OwnedStream.reset(OutFile);
|
OwnedStream.reset(OutFile);
|
||||||
}
|
}
|
||||||
|
|
|
@ -319,7 +319,7 @@ PlistDiagnostics::~PlistDiagnostics() {
|
||||||
|
|
||||||
// Open the file.
|
// Open the file.
|
||||||
std::string ErrMsg;
|
std::string ErrMsg;
|
||||||
llvm::raw_fd_ostream o(OutputFile.c_str(), false, ErrMsg);
|
llvm::raw_fd_ostream o(OutputFile.c_str(), false, /*Force=*/true, ErrMsg);
|
||||||
if (!ErrMsg.empty()) {
|
if (!ErrMsg.empty()) {
|
||||||
llvm::errs() << "warning: could not creat file: " << OutputFile << '\n';
|
llvm::errs() << "warning: could not creat file: " << OutputFile << '\n';
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1682,7 +1682,7 @@ static void SetUpBuildDumpLog(unsigned argc, char **argv,
|
||||||
|
|
||||||
std::string ErrorInfo;
|
std::string ErrorInfo;
|
||||||
BuildLogFile = new llvm::raw_fd_ostream(DumpBuildInformation.c_str(), false,
|
BuildLogFile = new llvm::raw_fd_ostream(DumpBuildInformation.c_str(), false,
|
||||||
ErrorInfo);
|
/*Force=*/true, ErrorInfo);
|
||||||
|
|
||||||
if (!ErrorInfo.empty()) {
|
if (!ErrorInfo.empty()) {
|
||||||
llvm::errs() << "error opening -dump-build-information file '"
|
llvm::errs() << "error opening -dump-build-information file '"
|
||||||
|
@ -1735,7 +1735,8 @@ static llvm::raw_ostream* ComputeOutFile(const std::string& InFile,
|
||||||
llvm::sys::Program::ChangeStdoutToBinary();
|
llvm::sys::Program::ChangeStdoutToBinary();
|
||||||
} else {
|
} else {
|
||||||
std::string Error;
|
std::string Error;
|
||||||
Ret = new llvm::raw_fd_ostream(OutFile.c_str(), Binary, Error);
|
Ret = new llvm::raw_fd_ostream(OutFile.c_str(), Binary,
|
||||||
|
/*Force=*/true, Error);
|
||||||
if (!Error.empty()) {
|
if (!Error.empty()) {
|
||||||
// FIXME: Don't fail this way.
|
// FIXME: Don't fail this way.
|
||||||
llvm::cerr << "ERROR: " << Error << "\n";
|
llvm::cerr << "ERROR: " << Error << "\n";
|
||||||
|
@ -2276,7 +2277,8 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
std::string ErrStr;
|
std::string ErrStr;
|
||||||
DependencyOS =
|
DependencyOS =
|
||||||
new llvm::raw_fd_ostream(DependencyFile.c_str(), false, ErrStr);
|
new llvm::raw_fd_ostream(DependencyFile.c_str(), false,
|
||||||
|
/*Force=*/true, ErrStr);
|
||||||
if (!ErrStr.empty()) {
|
if (!ErrStr.empty()) {
|
||||||
// FIXME: Use a proper diagnostic
|
// FIXME: Use a proper diagnostic
|
||||||
llvm::cerr << "unable to open dependency file: " + ErrStr;
|
llvm::cerr << "unable to open dependency file: " + ErrStr;
|
||||||
|
|
Loading…
Reference in New Issue