diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-09-13 05:16:45 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-09-13 05:16:45 +0000 |
commit | a95d3750441ac8ad03e36af8e6e74039c9a3109d (patch) | |
tree | ff6594ca38fba0ebad2d5a63583a909bdfb72a9f /lib/Rewrite | |
parent | 635d04fe2a14fe79ac9b3802b66f6314ca8bc539 (diff) |
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
Diffstat (limited to 'lib/Rewrite')
-rw-r--r-- | lib/Rewrite/HTMLRewrite.cpp | 8 | ||||
-rw-r--r-- | lib/Rewrite/Rewriter.cpp | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp index 43c04793f0..b411e568f6 100644 --- a/lib/Rewrite/HTMLRewrite.cpp +++ b/lib/Rewrite/HTMLRewrite.cpp @@ -20,7 +20,7 @@ #include "llvm/ADT/SmallString.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/Support/MemoryBuffer.h" -#include <sstream> +#include "llvm/Support/raw_ostream.h" using namespace clang; @@ -161,7 +161,8 @@ std::string html::EscapeText(const std::string& s, bool EscapeSpaces, bool ReplaceTabs) { unsigned len = s.size(); - std::ostringstream os; + std::string Str; + llvm::raw_string_ostream os(Str); for (unsigned i = 0 ; i < len; ++i) { @@ -272,7 +273,8 @@ void html::AddHeaderFooterInternalBuiltinCSS(Rewriter& R, unsigned FileID, SourceLocation StartLoc = SourceLocation::getFileLoc(FileID, 0); SourceLocation EndLoc = SourceLocation::getFileLoc(FileID, FileEnd-FileStart); - std::ostringstream os; + std::string s; + llvm::raw_string_ostream os(s); os << "<!doctype html>\n" // Use HTML 5 doctype "<html>\n<head>\n"; diff --git a/lib/Rewrite/Rewriter.cpp b/lib/Rewrite/Rewriter.cpp index e1a6651a9a..f414e1c5f2 100644 --- a/lib/Rewrite/Rewriter.cpp +++ b/lib/Rewrite/Rewriter.cpp @@ -16,7 +16,7 @@ #include "clang/AST/Stmt.h" #include "clang/Lex/Lexer.h" #include "clang/Basic/SourceManager.h" -#include <sstream> +#include "llvm/Support/raw_ostream.h" using namespace clang; void RewriteBuffer::RemoveText(unsigned OrigOffset, unsigned Size) { @@ -166,7 +166,8 @@ bool Rewriter::ReplaceStmt(Stmt *From, Stmt *To) { return true; // Get the new text. - std::ostringstream S; + std::string SStr; + llvm::raw_string_ostream S(SStr); To->printPretty(S); const std::string &Str = S.str(); |