If I run clang on the code below, either via my own FrontendAction and
libtooling or just with
clang -cc1 -analyze -analyze-checker debug.DumpCFG I get an CFG where the
default case
has no predecessor. If I compile the code to llvm and dump a CFG from opt
then all cases
are successors of the switch.
Is it possible to obtain a CFG from clang with all edges for the switch
statement?
I believe the edge from the switch to the default case is pruned because all of the enum values are covered by the switch. The analyzer is considering the default case as “not possible”.
I believe the edge from the switch to the default case is pruned because
all of the enum values are covered by the switch. The analyzer is
considering the default case as "not possible".
Is it possible to get a CFG before pruning? I've tried
BuildOptions.PruneTrivialFalseEdges = false, but that didn't help.