aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite/Core/Rewriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Rewrite/Core/Rewriter.cpp')
-rw-r--r--lib/Rewrite/Core/Rewriter.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Rewrite/Core/Rewriter.cpp b/lib/Rewrite/Core/Rewriter.cpp
index 4df967f39bc0..c1c6595d1622 100644
--- a/lib/Rewrite/Core/Rewriter.cpp
+++ b/lib/Rewrite/Core/Rewriter.cpp
@@ -13,14 +13,16 @@
//===----------------------------------------------------------------------===//
#include "clang/Rewrite/Core/Rewriter.h"
-#include "clang/AST/Stmt.h"
#include "clang/AST/Decl.h"
+#include "clang/AST/PrettyPrinter.h"
+#include "clang/AST/Stmt.h"
#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/raw_ostream.h"
using namespace clang;
raw_ostream &RewriteBuffer::write(raw_ostream &os) const {
@@ -416,6 +418,7 @@ bool Rewriter::IncreaseIndentation(CharSourceRange range,
return false;
}
+namespace {
// A wrapper for a file stream that atomically overwrites the target.
//
// Creates a file output stream for a temporary file in the constructor,
@@ -461,7 +464,7 @@ public:
}
bool ok() { return FileStream; }
- llvm::raw_ostream &getStream() { return *FileStream; }
+ raw_ostream &getStream() { return *FileStream; }
private:
DiagnosticsEngine &Diagnostics;
@@ -470,6 +473,7 @@ private:
OwningPtr<llvm::raw_fd_ostream> FileStream;
bool &AllWritten;
};
+} // end anonymous namespace
bool Rewriter::overwriteChangedFiles() {
bool AllWritten = true;