[dataflow] add HTML logger: browse code/cfg/analysis timeline/state
authorSam McCall <sam.mccall@gmail.com>
Wed, 8 Mar 2023 15:13:28 +0000 (16:13 +0100)
committerSam McCall <sam.mccall@gmail.com>
Wed, 19 Apr 2023 13:37:06 +0000 (15:37 +0200)
commita443b3d18ef4d01e767994845b3f2819480a7b48
tree681aeb8b5c1dfe24275c1f6aca8b0bc7301cc732
parent50639d3d0dfcc62405a04763a7603021408cfa84
[dataflow] add HTML logger: browse code/cfg/analysis timeline/state

With -dataflow-log=/dir we will write /dir/0.html etc for each
function analyzed.

These files show the function's code and CFG, and the path through
the CFG taken by the analysis. At each analysis point we can see the
lattice state.

Currently the lattice state dump is not terribly useful but we can
improve this: showing values associated with the current Expr,
simplifying flow condition, highlighting changes etc.

(Trying not to let this patch scope-creep too much, so I ripped out the
half-finished features)

Demo: https://htmlpreview.github.io/?https://gist.githubusercontent.com/sam-mccall/1746985bf13406bd19181af281aea9ff/raw/9718fdd48406dabccb3092acd983b4bd55da9dfa/analysis.html

Differential Revision: https://reviews.llvm.org/D146591
clang/include/clang/Analysis/FlowSensitive/Logger.h
clang/lib/Analysis/FlowSensitive/CMakeLists.txt
clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp [new file with mode: 0644]
clang/lib/Analysis/FlowSensitive/HTMLLogger.css [new file with mode: 0644]
clang/lib/Analysis/FlowSensitive/HTMLLogger.html [new file with mode: 0644]
clang/lib/Analysis/FlowSensitive/HTMLLogger.js [new file with mode: 0644]
clang/unittests/Analysis/FlowSensitive/LoggerTest.cpp
clang/utils/bundle_resources.py [new file with mode: 0644]