This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] print() JSONify: getNodeLabel implementation
ClosedPublic

Authored by Charusso on May 23 2019, 2:25 PM.

Diff Detail

Event Timeline

Charusso created this revision.May 23 2019, 2:25 PM
Charusso added a comment.EditedMay 23 2019, 2:40 PM

This one it a little-bit heavier what it should be. I have added the JsonSupport.h because I believe we have to space it at some point because some lines are too long. It was your request @NoQ to create something identical to the original spacing. Should I touch the spacing, or it is okay?

NoQ added inline comments.May 23 2019, 4:39 PM
clang/lib/Analysis/ProgramPoint.cpp
69–70

If i was to change one thing about these dumps, it'd be to make the spaces consistent.

93

Cf.

clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
3088–3110

The predecessors/successors part isn't very useful because we're combining multiple ExplodedGraph nodes into a single dumped node. If we print them at all, we should probably combine them with the ProgramPoint print (as each ProgramPoint corresponds to a real ExplodedGraph node). But i don't really find this info useful, as it's already displayed with arrows.

clang/test/Analysis/dump_egraph.c
13

Again, let's test the planned HTML generator separately.

NoQ accepted this revision.May 23 2019, 4:40 PM

Great job tho!

This revision is now accepted and ready to land.May 23 2019, 4:40 PM

What do you mean by consistent spacing?

We had:

Block Entrance: B2
--------
PreStmtPurgeDeadSymbols
Tag:ExprEngine : Clean Node
--------
DeclRefExpr S2079258 <0x19d70c0> RM
line=2715 col=11
PostLValue

We have:

"program_points": [
  { "kind": "Block Entrance", "block_id": 2, "tag": null }
  { "kind": "PreStmtPurgeDeadSymbols", "tag": "ExprEngine : Clean Node" }
  { "kind": "Statement", "stmt_kind": "DeclRefExpr", "stmt_id": 2079258, "pointer": 0x3683e80, "pretty": "RM", "line": 2715, "column": 11, "stmt_point_kind": "PostLValue", "tag": null }
],

Could you show that by an example what improvements would you see? I think it is just long, but not problematic. My main problem is the order of the usefulness of the information, but it is a problem in every print() so I have not touched that yet.

Charusso updated this revision to Diff 201575.EditedMay 27 2019, 1:47 PM
  • 100% pure JSON.
  • Removed pred/succ.
  • Removed TODO.
Charusso updated this revision to Diff 201908.May 29 2019, 7:06 AM
  • Just rebase.
Charusso edited the summary of this revision. (Show Details)May 29 2019, 7:06 AM
Charusso set the repository for this revision to rC Clang.May 29 2019, 10:18 AM
NoQ added a comment.May 29 2019, 10:47 AM

What do you mean by consistent spacing?

I meant BlockEntrance vs. Block Entrance, etc.

Charusso updated this revision to Diff 201988.May 29 2019, 10:55 AM
Charusso marked 4 inline comments as done.
  • Remove unintended spaces.
This revision was automatically updated to reflect the committed changes.