[LLVM up] Update for raw_fd_ostream change. This fixes a FIXME that
the Backend output should be done in binary mode.
- I'd appreciate it if someone who has a Windows build could verify
this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59221 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/AnalysisConsumer.cpp b/Driver/AnalysisConsumer.cpp
index f606c87..10e6968 100644
--- a/Driver/AnalysisConsumer.cpp
+++ b/Driver/AnalysisConsumer.cpp
@@ -554,7 +554,7 @@
llvm::OwningPtr<llvm::raw_fd_ostream> Stream;
std::string filename = Filename.toString();
- Stream.reset(new llvm::raw_fd_ostream(filename.c_str(), ErrMsg));
+ Stream.reset(new llvm::raw_fd_ostream(filename.c_str(), false, ErrMsg));
if (!ErrMsg.empty())
return 0;
diff --git a/Driver/Backend.cpp b/Driver/Backend.cpp
index f16c069..aad2d04 100644
--- a/Driver/Backend.cpp
+++ b/Driver/Backend.cpp
@@ -170,8 +170,7 @@
OutputFile = Path.toString();
}
- // FIXME: Should be binary.
- AsmOutStream = new raw_fd_ostream(OutputFile.c_str(), Error);
+ AsmOutStream = new raw_fd_ostream(OutputFile.c_str(), true, Error);
if (!Error.empty())
return false;
}
diff --git a/Driver/CacheTokens.cpp b/Driver/CacheTokens.cpp
index 5aeb1a6..6b37830 100644
--- a/Driver/CacheTokens.cpp
+++ b/Driver/CacheTokens.cpp
@@ -115,7 +115,7 @@
uint32_t idcount = 0;
std::string ErrMsg;
- llvm::raw_fd_ostream Out(OutFile.c_str(), ErrMsg);
+ llvm::raw_fd_ostream Out(OutFile.c_str(), true, ErrMsg);
if (!ErrMsg.empty()) {
os << "PCH error: " << ErrMsg << "\n";
diff --git a/Driver/PrintPreprocessedOutput.cpp b/Driver/PrintPreprocessedOutput.cpp
index fd150ae..923439c 100644
--- a/Driver/PrintPreprocessedOutput.cpp
+++ b/Driver/PrintPreprocessedOutput.cpp
@@ -476,7 +476,7 @@
// Open the output buffer.
std::string Err;
- llvm::raw_fd_ostream OS(OutFile.empty() ? "-" : OutFile.c_str(), Err);
+ llvm::raw_fd_ostream OS(OutFile.empty() ? "-" : OutFile.c_str(), false, Err);
if (!Err.empty()) {
fprintf(stderr, "%s\n", Err.c_str());
exit(1);
diff --git a/Driver/RewriteMacros.cpp b/Driver/RewriteMacros.cpp
index 8931014..d10bf55 100644
--- a/Driver/RewriteMacros.cpp
+++ b/Driver/RewriteMacros.cpp
@@ -212,7 +212,7 @@
OutFile = &llvm::outs();
} else if (!OutFileName.empty()) {
std::string Err;
- OutFile = new llvm::raw_fd_ostream(OutFileName.c_str(), Err);
+ OutFile = new llvm::raw_fd_ostream(OutFileName.c_str(), false, Err);
OwnedStream.reset(OutFile);
} else if (InFileName == "-") {
OutFile = &llvm::outs();
@@ -221,7 +221,7 @@
Path.eraseSuffix();
Path.appendSuffix("cpp");
std::string Err;
- OutFile = new llvm::raw_fd_ostream(Path.toString().c_str(), Err);
+ OutFile = new llvm::raw_fd_ostream(Path.toString().c_str(), false, Err);
OwnedStream.reset(OutFile);
}
diff --git a/Driver/RewriteObjC.cpp b/Driver/RewriteObjC.cpp
index 65e8841..6d67323 100644
--- a/Driver/RewriteObjC.cpp
+++ b/Driver/RewriteObjC.cpp
@@ -4107,7 +4107,7 @@
OutFile = &llvm::outs();
} else if (!OutFileName.empty()) {
std::string Err;
- OutFile = new llvm::raw_fd_ostream(OutFileName.c_str(), Err);
+ OutFile = new llvm::raw_fd_ostream(OutFileName.c_str(), false, Err);
OwnedStream.reset(OutFile);
} else if (InFileName == "-") {
OutFile = &llvm::outs();
@@ -4116,7 +4116,7 @@
Path.eraseSuffix();
Path.appendSuffix("cpp");
std::string Err;
- OutFile = new llvm::raw_fd_ostream(Path.toString().c_str(), Err);
+ OutFile = new llvm::raw_fd_ostream(Path.toString().c_str(), false, Err);
OwnedStream.reset(OutFile);
}
diff --git a/Driver/SerializationTest.cpp b/Driver/SerializationTest.cpp
index 9f93479..e489a19 100644
--- a/Driver/SerializationTest.cpp
+++ b/Driver/SerializationTest.cpp
@@ -65,7 +65,7 @@
{
// Pretty-print the decls to a temp file.
std::string Err;
- llvm::raw_fd_ostream DeclPP(FNameDeclPrint.c_str(), Err);
+ llvm::raw_fd_ostream DeclPP(FNameDeclPrint.c_str(), true, Err);
assert (Err.empty() && "Could not open file for printing out decls.");
llvm::OwningPtr<ASTConsumer> FilePrinter(CreateASTPrinter(&DeclPP));
@@ -89,7 +89,7 @@
{
// Pretty-print the deserialized decls to a temp file.
std::string Err;
- llvm::raw_fd_ostream DeclPP(FNameDeclPrint.c_str(), Err);
+ llvm::raw_fd_ostream DeclPP(FNameDeclPrint.c_str(), true, Err);
assert (Err.empty() && "Could not open file for printing out decls.");
llvm::OwningPtr<ASTConsumer> FilePrinter(CreateASTPrinter(&DeclPP));
diff --git a/lib/AST/InheritViz.cpp b/lib/AST/InheritViz.cpp
index 5e4dab4..dd2fc14 100644
--- a/lib/AST/InheritViz.cpp
+++ b/lib/AST/InheritViz.cpp
@@ -149,7 +149,7 @@
llvm::errs() << "Writing '" << Filename.c_str() << "'... ";
- llvm::raw_fd_ostream O(Filename.c_str(), ErrMsg);
+ llvm::raw_fd_ostream O(Filename.c_str(), false, ErrMsg);
if (ErrMsg.empty()) {
InheritanceHierarchyWriter Writer(Context, O);
diff --git a/lib/Driver/PlistDiagnostics.cpp b/lib/Driver/PlistDiagnostics.cpp
index 5005241..b9e35aa 100644
--- a/lib/Driver/PlistDiagnostics.cpp
+++ b/lib/Driver/PlistDiagnostics.cpp
@@ -195,7 +195,7 @@
// Now create the plist file.
std::string ErrMsg;
- llvm::raw_fd_ostream o(H.toString().c_str(), ErrMsg);
+ llvm::raw_fd_ostream o(H.toString().c_str(), false, ErrMsg);
if (!ErrMsg.empty()) {
llvm::errs() << "warning: could not creat file: " << H.toString() << '\n';