aboutsummaryrefslogtreecommitdiff
path: root/Driver/HTMLDiagnostics.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-03-31 23:30:12 +0000
committerTed Kremenek <kremenek@apple.com>2008-03-31 23:30:12 +0000
commit33bd942e7449f044ce6a9c81a008407dce4215da (patch)
treeac98b7825115e840838b78e21c9bb2ae0dffd4b8 /Driver/HTMLDiagnostics.cpp
parentade9bf0fabca700bc2a1dadb071179d03515e3cb (diff)
Embed linkable IDs in message bubbles.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/HTMLDiagnostics.cpp')
-rw-r--r--Driver/HTMLDiagnostics.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/Driver/HTMLDiagnostics.cpp b/Driver/HTMLDiagnostics.cpp
index 7f6a369de7..917949fac1 100644
--- a/Driver/HTMLDiagnostics.cpp
+++ b/Driver/HTMLDiagnostics.cpp
@@ -44,7 +44,9 @@ public:
virtual void HandlePathDiagnostic(const PathDiagnostic& D);
- void HandlePiece(Rewriter& R, const PathDiagnosticPiece& P, unsigned num);
+ void HandlePiece(Rewriter& R, const PathDiagnosticPiece& P,
+ unsigned num, unsigned max);
+
void HighlightRange(Rewriter& R, SourceRange Range, unsigned MainFileID);
};
@@ -98,11 +100,12 @@ void HTMLDiagnostics::HandlePathDiagnostic(const PathDiagnostic& D) {
// Process the path.
unsigned n = D.size();
+ unsigned max = n;
for (PathDiagnostic::const_reverse_iterator I=D.rbegin(), E=D.rend();
I!=E; ++I, --n) {
- HandlePiece(R, *I, n);
+ HandlePiece(R, *I, n, max);
}
// Add line numbers, header, footer, etc.
@@ -172,7 +175,7 @@ void HTMLDiagnostics::HandlePathDiagnostic(const PathDiagnostic& D) {
void HTMLDiagnostics::HandlePiece(Rewriter& R,
const PathDiagnosticPiece& P,
- unsigned num) {
+ unsigned num, unsigned max) {
// For now, just draw a box above the line in question, and emit the
// warning.
@@ -212,7 +215,14 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R,
std::ostringstream os;
os << "\n<tr><td class=\"num\"></td><td class=\"line\">"
- << "<div class=\"msg\" style=\"margin-left:"
+ << "<div id=\"";
+
+ if (num == max)
+ os << "EndPath";
+ else
+ os << "Path" << num;
+
+ os << "\" class=\"msg\" style=\"margin-left:"
<< PosNo << "ex\">";
os << html::EscapeText(P.getString()) << "</div></td></tr>";