This is an archive of the discontinued LLVM Phabricator instance.

[StaticAnalyzer] Added notes to the plist output
ClosedPublic

Authored by Szelethus on Apr 7 2018, 1:34 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

Szelethus created this revision.Apr 7 2018, 1:34 PM
NoQ added a subscriber: NoQ.Apr 7 2018, 4:15 PM

The output looks reasonable to me, but we'll need to see if other consumers of the plist output (IDEs that supports the analyzer, such as Xcode) will be able to accept the modified output (at least, will be able to ignore it). I'll have a look.

NoQ edited reviewers, added: NoQ; removed: dergachev.a.Apr 7 2018, 4:16 PM

Did you have some time to check on those programs? :)

NoQ added a comment.Apr 13 2018, 8:35 PM

Sorry, overwhelmed a bit, i'll try to get to this as soon as possible.

Btw, what sort of UI are you trying to make these extra note pieces of mine work with? Was -analyzer-config notes-as-events=true of any help?

Btw, what sort of UI are you trying to make these extra note pieces of mine work with?

I'm also developing a checker: https://reviews.llvm.org/D45532. This checker emits very important information in notes. When I tried testing it with Ericsson's CodeChecker, I realized that notes aren't displayed. I'm planning to extend it so it will be able to.

Was -analyzer-config notes-as-events=true of any help?

Never knew about the existence of this flag. Woops. I'll only be able to check it out tomorrow, but I'll post my findings here as soon as I have them :)

I just had a look with -analyzer-config notes-as-events=true, and it works (with CodeChecker, at least). I'd still implement a better support for notes, but this is a great workaround for now. Thanks!

whisperity added a comment.EditedApr 16 2018, 6:50 AM

@NoQ The problem with emitting notes as events is that we lose the information that the node was a note. How does Xcode behave with these notes? Does it ignore them, or can read them from the command-line output of the analyser?

NoQ accepted this revision.Apr 20 2018, 2:06 PM

Checked this out, seems to be safely ignored for now. The .plist format is pretty resistant to this sort of stuff because most APIs to handle it are almost treating it as native arrays/dictionaries, so i guess it should be fine.

@NoQ The problem with emitting notes as events is that we lose the information that the node was a note. How does Xcode behave with these notes? Does it ignore them, or can read them from the command-line output of the analyser?

Yep, precisely: notes are completely different from path pieces - they shouldn't be connected to the rest of the path via arrows or necessarily have a certain ordering with respect to the path.

For now notes are ignored by Xcode; there's no good UI for them implemented. They are also not used by many on-by-default checkers, so they're mostly an experiment for now.

This revision is now accepted and ready to land.Apr 20 2018, 2:06 PM

Can someone commit this for me? I don't have a write access.

This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.
NoQ added a comment.Apr 24 2018, 1:52 PM

Yup thanks!~