aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/HTMLDiagnostics.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-09-13 05:16:45 +0000
committerTed Kremenek <kremenek@apple.com>2008-09-13 05:16:45 +0000
commita95d3750441ac8ad03e36af8e6e74039c9a3109d (patch)
treeff6594ca38fba0ebad2d5a63583a909bdfb72a9f /lib/Driver/HTMLDiagnostics.cpp
parent635d04fe2a14fe79ac9b3802b66f6314ca8bc539 (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/Driver/HTMLDiagnostics.cpp')
-rw-r--r--lib/Driver/HTMLDiagnostics.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/Driver/HTMLDiagnostics.cpp b/lib/Driver/HTMLDiagnostics.cpp
index e691882098..5025e87e59 100644
--- a/lib/Driver/HTMLDiagnostics.cpp
+++ b/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=\"";