Patch by Csaba Hruska!
"Here is a patch what replaces std::ostream with llvm::raw_ostream. This patch
covers the AST library, but ignores Analysis lib."
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56185 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/SerializationTest.cpp b/Driver/SerializationTest.cpp
index 50d06d4..9f93479 100644
--- a/Driver/SerializationTest.cpp
+++ b/Driver/SerializationTest.cpp
@@ -64,8 +64,9 @@
TranslationUnit& TU) {
{
// Pretty-print the decls to a temp file.
- std::ofstream DeclPP(FNameDeclPrint.c_str());
- assert (DeclPP && "Could not open file for printing out decls.");
+ std::string Err;
+ llvm::raw_fd_ostream DeclPP(FNameDeclPrint.c_str(), Err);
+ assert (Err.empty() && "Could not open file for printing out decls.");
llvm::OwningPtr<ASTConsumer> FilePrinter(CreateASTPrinter(&DeclPP));
for (TranslationUnit::iterator I=TU.begin(), E=TU.end(); I!=E; ++I)
@@ -87,8 +88,9 @@
{
// Pretty-print the deserialized decls to a temp file.
- std::ofstream DeclPP(FNameDeclPrint.c_str());
- assert (DeclPP && "Could not open file for printing out decls.");
+ std::string Err;
+ llvm::raw_fd_ostream DeclPP(FNameDeclPrint.c_str(), Err);
+ assert (Err.empty() && "Could not open file for printing out decls.");
llvm::OwningPtr<ASTConsumer> FilePrinter(CreateASTPrinter(&DeclPP));
for (TranslationUnit::iterator I=NewTU->begin(), E=NewTU->end(); I!=E; ++I)