aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-15 21:25:08 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-15 21:25:08 +0000
commit4b0f81323b518429203051bbcd4864bbf4b000a9 (patch)
tree76fa906db8f72b7acecf620c5597fb46c2b71972
parent6e6eff7aaac376a08cdb3c6ae9d177491f800ca8 (diff)
For HTML diagnostics, output more information about a bug report.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49742 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Driver/HTMLDiagnostics.cpp22
-rw-r--r--lib/Rewrite/HTMLRewrite.cpp11
2 files changed, 27 insertions, 6 deletions
diff --git a/Driver/HTMLDiagnostics.cpp b/Driver/HTMLDiagnostics.cpp
index 05e4a51656..327a77f8df 100644
--- a/Driver/HTMLDiagnostics.cpp
+++ b/Driver/HTMLDiagnostics.cpp
@@ -124,14 +124,26 @@ void HTMLDiagnostics::HandlePathDiagnostic(const PathDiagnostic& D) {
if (DirName == ".")
DirName = llvm::sys::Path::GetCurrentDirectory().toString();
- // Add the name of the file as an <h1> tag.
-
+ // Add the name of the file as an <h1> tag.
+
{
std::ostringstream os;
- os << "<h1>" << html::EscapeText(DirName)
- << "/" << html::EscapeText(Entry->getName()) << "</h1>\n";
-
+ os << "<h3>Bug Summary</h3>\n<table class=\"simpletable\">\n"
+ "<tr><td class=\"rowname\">File:</td><td>"
+ << html::EscapeText(DirName)
+ << html::EscapeText(Entry->getName())
+ << "</td></tr>\n<tr><td class=\"rowname\">Location:</td><td>"
+ "<a href=\"#EndPath\">line "
+ << (*D.rbegin()).getLocation().getLogicalLineNumber()
+ << ", column "
+ << (*D.rbegin()).getLocation().getLogicalColumnNumber()
+ << "</a></td></tr>\n"
+ "<tr><td class=\"rowname\">Description:</td><td>"
+ << D.getDescription()
+ << "</td></tr>\n</table>\n"
+ "<h3>Annotated Source Code</h3>\n";
+
R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str());
}
diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp
index 2b844da1fd..bc7864eebd 100644
--- a/lib/Rewrite/HTMLRewrite.cpp
+++ b/lib/Rewrite/HTMLRewrite.cpp
@@ -193,7 +193,7 @@ void html::AddHeaderFooterInternalBuiltinCSS(Rewriter& R, unsigned FileID) {
"<style type=\"text/css\">\n"
" body { color:#000000; background-color:#ffffff }\n"
" body { font-family:Helvetica, sans-serif; font-size:10pt }\n"
- " h1 { font-size:12pt }\n"
+ " h1 { font-size:14pt }\n"
" .code { border-spacing:0px; width:100%; }\n"
" .code { font-family: \"Andale Mono\", monospace; font-size:10pt }\n"
" .code { line-height: 1.2em }\n"
@@ -213,6 +213,15 @@ void html::AddHeaderFooterInternalBuiltinCSS(Rewriter& R, unsigned FileID) {
" .mrange { background-color:#dfddf3 }\n"
" .mrange { border-bottom:1px solid #6F9DBE }\n"
" .PathIndex { font-weight: bold }\n"
+ " table.simpletable {\n"
+ " padding: 5px;\n"
+ " font-size:12pt;\n"
+ " margin:20px;\n"
+ " border-collapse: collapse; border-spacing: 0px;\n"
+ " }\n"
+ " td.rowname {\n"
+ " text-align:right; font-weight:bold; color:#444444;\n"
+ " padding-right:2ex; }\n"
"</style>\n</head>\n<body>");
// Generate footer