[analyzer] exploded-graph-rewriter: NFC: Refactor explorers into trimmers.
authorArtem Dergachev <artem.dergachev@gmail.com>
Tue, 13 Aug 2019 23:04:50 +0000 (23:04 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Tue, 13 Aug 2019 23:04:50 +0000 (23:04 +0000)
commit0b26891f3f2b75dcc8f1a0f3a34342ce27570a2c
treec3c22b7c54c51e9f7c663f63697e49bb1fc782b7
parente9e36354531e0dde20fbd7dac9749244a52e61be
[analyzer] exploded-graph-rewriter: NFC: Refactor explorers into trimmers.

Explorers aren't the right abstraction. For the purposes of displaying svg files
we don't care in which order do we explore the nodes. We may care about this for
other analyses, but we're not there yet.

The function of cutting out chunks of the graph is performed poorly by
the explorers, because querying predecessors/successors on the explored nodes
yields original successors/predecessors even if they aren't being explored.

Introduce a new entity, "trimmers", that do one thing but to it right: cut out
chunks of the graph. Trimmers mutate the graph, so stale edges aren't even
visible to their consumers in the pipeline. Additionally, trimmers are
intrinsically composable: multiple trimmers can be applied to the graph
sequentially.

Refactor the single-path explorer into the single-path trimmer.
Rename the test file for consistency.

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

llvm-svn: 368767
clang/test/Analysis/exploded-graph-rewriter/trimmers.dot [moved from clang/test/Analysis/exploded-graph-rewriter/explorers.dot with 100% similarity]
clang/utils/analyzer/exploded-graph-rewriter.py