analyzer: fixes to -fdump-analyzer-json
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 14 Jan 2021 20:39:14 +0000 (15:39 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Thu, 14 Jan 2021 20:39:14 +0000 (15:39 -0500)
commitdea4a32b24fb888532c47f3920f6910b3c94a8a0
treea8a10ba4456583d6457f1bd4144d0bae0e824229
parent8a18261afd923151b8d2a37f667e4673b27acd3f
analyzer: fixes to -fdump-analyzer-json

I've been implementing a PyGTK viewer for the output of
-fdump-analyzer-json, to help me debug analyzer issues:
  https://github.com/davidmalcolm/gcc-analyzer-viewer
The viewer is very much just a work in progress.

This patch adds some fields that were missing from the dump, and
fixes some mistakes I spotted whilst working on the viewer.

gcc/analyzer/ChangeLog:
* engine.cc (strongly_connected_components::to_json): New.
(worklist::to_json): New.
(exploded_graph::to_json): JSON-ify the worklist.
* exploded-graph.h (strongly_connected_components::to_json): New
decl.
(worklist::to_json): New decl.
* store.cc (store::to_json): Fix comment.
* supergraph.cc (supernode::to_json): Fix reference to
"returning_call" in comment.  Add optional "fun" to JSON.
(edge_kind_to_string): New.
(superedge::to_json): Add "kind" to JSON.
gcc/analyzer/engine.cc
gcc/analyzer/exploded-graph.h
gcc/analyzer/store.cc
gcc/analyzer/supergraph.cc