Open Quuxplusone opened 5 years ago
Bugzilla Link | PR42601 |
Status | CONFIRMED |
Importance | P normal |
Reported by | Erich Keane (erich.keane@intel.com) |
Reported on | 2019-07-12 07:52:43 -0700 |
Last modified on | 2019-07-12 09:10:45 -0700 |
Version | trunk |
Hardware | PC Linux |
CC | dcoughlin@apple.com, denis.bakhvalov@intel.com, ekarpenkov@apple.com, ganna@apple.com, llvm-bugs@lists.llvm.org, noqnoqneo@gmail.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
Yeah, that's kinda a bug, but nobody cares most of the time.
Because the Static Analyzer conducts multiple path-sensitive analyses per invocation (usually one per top-level function in the translation unit's call graph), it is natural that it produces multiple exploded graph dumps - exactly one graph per analysis.
Historically the exploded graph dumps were emitted via -analyzer-viz-egraph-graphviz and/or via -analyzer-checker debug.ViewExplodedGraph. In both variants every analysis graph goes into a new temporary file with a random name somewhere in /tmp.
However at some point we decided to add tests for exploded graph dumps, so we added a new flag, -analyzer-dump-egraph=file.dot, so that to have a stable filename that you can later pass FileCheck.
Now, this new flag obviously doesn't work for multiple analyses, so any test that would require multiple analyses would have to be split into multiple translation units. This is a problem but not a real problem, as you can always split the test up.
Additionally, the new option is still useful for everyday debugging (after all, exploded graph dumper is a self-debugging facility of the Static Analyzer). It's easier to remember and you don't need to copy-paste the file name from the standard output in order to process it. Of course, most real-world translation units contain multiple analysis entry points. However, when debugging, you usually don't care about all analyses at once; you usually care about only one of them. And once you make up your mind on what top-level function you want to debug, you can use -analyze-function to only analyze that function, and therefore display analyze one exploded graph, so no overwriting is going on.
See also https://clang-analyzer.llvm.org/checker_dev_manual.html#commands