From 80bae763da8bf3f3c73379a1e5d10f5bce266bca Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 2 Mar 2009 23:05:40 +0000 Subject: Adjust HTML message bubbles to utilize information from PathDiagnosticPiece::Kind. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65891 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/HTMLDiagnostics.cpp | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'lib/Frontend/HTMLDiagnostics.cpp') diff --git a/lib/Frontend/HTMLDiagnostics.cpp b/lib/Frontend/HTMLDiagnostics.cpp index 9996fbbcd7..60e99be01f 100644 --- a/lib/Frontend/HTMLDiagnostics.cpp +++ b/lib/Frontend/HTMLDiagnostics.cpp @@ -388,7 +388,7 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID, // Next, determine the approximate size of the message bubble in em. unsigned em; - const unsigned max_line = 120; + const unsigned max_line = 110; if (max_token >= max_line) em = max_token / 2; @@ -407,9 +407,16 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID, em = characters / 2; } - // Now generate the message bubble. - std::string s; - llvm::raw_string_ostream os(s); + // Now generate the message bubble. + const char *Kind = 0; + switch (P.getKind()) { + default: break; + case PathDiagnosticPiece::Event: Kind = "Event"; break; + case PathDiagnosticPiece::ControlFlow: Kind = "Control"; break; + } + + std::string sbuf; + llvm::raw_string_ostream os(sbuf); os << "\n
"; - if (max > 1) - os << "[" << num << "] "; + if (max > 1) { + os << "
"; + os << "
" << num << "
"; + os << "
"; + } + + os << html::EscapeText(Msg); + + if (max > 1) { + os << "
"; + } - os << html::EscapeText(Msg) << "
"; + os << ""; // Insert the new html. unsigned DisplayPos = LineEnd - FileStart; -- cgit v1.2.3-18-g5258