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 | 2d470fc0ba6ae4b0ab51fde2e823b3af1879deab (patch) | |
| tree | 3e44d4fa22313b5818c9387db34367524373f8e3 /clang/lib/Driver/HTMLDiagnostics.cpp | |
| parent | a5804effedc7084ecd86a54b5da0933bda17c83e (diff) | |
| download | bcm5719-llvm-2d470fc0ba6ae4b0ab51fde2e823b3af1879deab.tar.gz bcm5719-llvm-2d470fc0ba6ae4b0ab51fde2e823b3af1879deab.zip | |
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."
llvm-svn: 56185
Diffstat (limited to 'clang/lib/Driver/HTMLDiagnostics.cpp')
| -rw-r--r-- | clang/lib/Driver/HTMLDiagnostics.cpp | 20 | 
1 files changed, 13 insertions, 7 deletions
| diff --git a/clang/lib/Driver/HTMLDiagnostics.cpp b/clang/lib/Driver/HTMLDiagnostics.cpp index e6918820984..5025e87e596 100644 --- a/clang/lib/Driver/HTMLDiagnostics.cpp +++ b/clang/lib/Driver/HTMLDiagnostics.cpp @@ -23,9 +23,9 @@  #include "llvm/Support/Compiler.h"  #include "llvm/Support/MemoryBuffer.h"  #include "llvm/Support/Streams.h" +#include "llvm/Support/raw_ostream.h"  #include "llvm/System/Path.h"  #include <fstream> -#include <sstream>  using namespace clang; @@ -220,7 +220,8 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {    // Add the name of the file as an <h1> tag.      { -    std::ostringstream os; +    std::string s; +    llvm::raw_string_ostream os(s);      os << "<h3>Bug Summary</h3>\n<table class=\"simpletable\">\n"            "<tr><td class=\"rowname\">File:</td><td>" @@ -252,26 +253,30 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {    const std::string& BugDesc = D.getDescription();    if (!BugDesc.empty()) { -    std::ostringstream os; +    std::string s; +    llvm::raw_string_ostream os(s);      os << "\n<!-- BUGDESC " << BugDesc << " -->\n";      R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str());    }    { -    std::ostringstream os; +    std::string s; +    llvm::raw_string_ostream os(s);      os << "\n<!-- BUGFILE " << DirName << Entry->getName() << " -->\n";      R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str());    }    { -    std::ostringstream os; +    std::string s; +    llvm::raw_string_ostream os(s);      os << "\n<!-- BUGLINE " << D.back()->getLocation().getLogicalLineNumber()         << " -->\n";      R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str());    }    { -    std::ostringstream os; +    std::string s; +    llvm::raw_string_ostream os(s);      os << "\n<!-- BUGPATHLENGTH " << D.size() << " -->\n";      R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str());    } @@ -365,7 +370,8 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, unsigned BugFileID,    // Create the html for the message. -  std::ostringstream os; +  std::string s; +  llvm::raw_string_ostream os(s);    os << "\n<tr><td class=\"num\"></td><td class=\"line\">"       << "<div id=\""; | 

