Skip to content

Commit 896feaf

Browse files
committed
[Analyzer] Add support for displaying cross-file diagnostic paths in HTML output
This change adds support for cross-file diagnostic paths in html output. If the diagnostic path is not cross-file, there is no change in the output. Patch by Vlad Tsyrklevich! Differential Revision: https://reviews.llvm.org/D30406 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309968 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent fc39168 commit 896feaf

14 files changed

+285
-129
lines changed

include/clang/StaticAnalyzer/Core/Analyses.def

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ ANALYSIS_CONSTRAINTS(Z3Constraints, "z3", "Use Z3 contraint solver", CreateZ3Con
2828
#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATEFN)
2929
#endif
3030

31-
ANALYSIS_DIAGNOSTICS(HTML, "html", "Output analysis results using HTML", createHTMLDiagnosticConsumer)
31+
ANALYSIS_DIAGNOSTICS(HTML, "html", "Output analysis results using HTML", createHTMLDiagnosticConsumer)
32+
ANALYSIS_DIAGNOSTICS(HTML_SINGLE_FILE, "html-single-file", "Output analysis results using HTML (not allowing for multi-file bugs)", createHTMLSingleFileDiagnosticConsumer)
3233
ANALYSIS_DIAGNOSTICS(PLIST, "plist", "Output analysis results using Plists", createPlistDiagnosticConsumer)
33-
ANALYSIS_DIAGNOSTICS(PLIST_MULTI_FILE, "plist-multi-file", "Output analysis results using Plists (allowing for mult-file bugs)", createPlistMultiFileDiagnosticConsumer)
34+
ANALYSIS_DIAGNOSTICS(PLIST_MULTI_FILE, "plist-multi-file", "Output analysis results using Plists (allowing for multi-file bugs)", createPlistMultiFileDiagnosticConsumer)
3435
ANALYSIS_DIAGNOSTICS(PLIST_HTML, "plist-html", "Output analysis results using HTML wrapped with Plists", createPlistHTMLDiagnosticConsumer)
3536
ANALYSIS_DIAGNOSTICS(TEXT, "text", "Text output of analysis results", createTextPathDiagnosticConsumer)
3637

lib/Rewrite/HTMLRewrite.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,11 @@ void html::AddHeaderFooterInternalBuiltinCSS(Rewriter &R, FileID FID,
289289
" body { color:#000000; background-color:#ffffff }\n"
290290
" body { font-family:Helvetica, sans-serif; font-size:10pt }\n"
291291
" h1 { font-size:14pt }\n"
292+
" .FileName { margin-top: 5px; margin-bottom: 5px; display: inline; }\n"
293+
" .FileNav { margin-left: 5px; margin-right: 5px; display: inline; }\n"
294+
" .FileNav a { text-decoration:none; font-size: larger; }\n"
295+
" .divider { margin-top: 30px; margin-bottom: 30px; height: 15px; }\n"
296+
" .divider { background-color: gray; }\n"
292297
" .code { border-collapse:collapse; width:100%; }\n"
293298
" .code { font-family: \"Monospace\", monospace; font-size:10pt }\n"
294299
" .code { line-height: 1.2em }\n"

0 commit comments

Comments
 (0)