diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-02 23:05:40 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-02 23:05:40 +0000 |
commit | 80bae763da8bf3f3c73379a1e5d10f5bce266bca (patch) | |
tree | b87237de69bdcc44d2a52a93fcaa7665cc42487b /lib/Frontend/HTMLDiagnostics.cpp | |
parent | 84f0ea849e79b08093933970c056d8b8d7be3c82 (diff) | |
download | clang-80bae763da8bf3f3c73379a1e5d10f5bce266bca.tar.gz |
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
Diffstat (limited to 'lib/Frontend/HTMLDiagnostics.cpp')
-rw-r--r-- | lib/Frontend/HTMLDiagnostics.cpp | 38 |
1 files changed, 26 insertions, 12 deletions
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<tr><td class=\"num\"></td><td class=\"line\"><div id=\""; @@ -419,19 +426,26 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID, os << "Path" << num; os << "\" class=\"msg"; - switch (P.getKind()) { - default: break; - case PathDiagnosticPiece::Event: os << " msgEvent"; break; - case PathDiagnosticPiece::ControlFlow: os << " msgControl"; break; - } + if (Kind) os << " msg" << Kind; os << "\" style=\"margin-left:" << PosNo << "ex"; if (em < max_line/2) os << "; max-width:" << em << "em"; os << "\">"; - if (max > 1) - os << "<span class=\"PathIndex\">[" << num << "]</span> "; + if (max > 1) { + os << "<table class=\"msgT\"><tr><td valign=\"top\">"; + os << "<div class=\"PathIndex"; + if (Kind) os << " PathIndex" << Kind; + os << "\">" << num << "</div>"; + os << "</td><td>"; + } + + os << html::EscapeText(Msg); + + if (max > 1) { + os << "</td></tr></table>"; + } - os << html::EscapeText(Msg) << "</div></td></tr>"; + os << "</div></td></tr>"; // Insert the new html. unsigned DisplayPos = LineEnd - FileStart; |