[analyzer] support a mode to only show relevant lines in HTML diagnostics
authorGeorge Karpenkov <ekarpenkov@apple.com>
Wed, 17 Jan 2018 02:59:11 +0000 (02:59 +0000)
committerGeorge Karpenkov <ekarpenkov@apple.com>
Wed, 17 Jan 2018 02:59:11 +0000 (02:59 +0000)
commita5ddd3cacb01ede6576d14d7ff9a3faee7d80f06
treee4315f5c4e8db7028c24b503db360a289a9c7803
parent8321ad9ffc1290f914f7065965085d32961fc941
[analyzer] support a mode to only show relevant lines in HTML diagnostics

HTML diagnostics can be an overwhelming blob of pages of code.
This patch adds a checkbox which filters this list down to only the
lines *relevant* to the counterexample by e.g. skipping branches which
analyzer has assumed to be infeasible at a time.

The resulting amount of output is much smaller, and often fits on one
screen, and also provides a much more readable diagnostics.

Differential Revision: https://reviews.llvm.org/D41378

llvm-svn: 322612
12 files changed:
clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
clang/lib/Rewrite/HTMLRewrite.cpp
clang/lib/StaticAnalyzer/Core/BugReporter.cpp
clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
clang/test/Analysis/html_diagnostics/relevant_lines/header.h [new file with mode: 0644]
clang/test/Analysis/html_diagnostics/relevant_lines/macros_same_file.c [new file with mode: 0644]
clang/test/Analysis/html_diagnostics/relevant_lines/multifile.c [new file with mode: 0644]
clang/test/Analysis/html_diagnostics/relevant_lines/multiline_func_def.c [new file with mode: 0644]
clang/test/Analysis/html_diagnostics/relevant_lines/objcmethods.m [new file with mode: 0644]
clang/test/Analysis/html_diagnostics/relevant_lines/simple_conditional.c [new file with mode: 0644]
clang/test/Analysis/html_diagnostics/relevant_lines/unused_header.c [new file with mode: 0644]