[StaticAnalyzer] Added notes to the plist output
AcceptedPublic

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

Details

Summary

Added notes to -analyzer-output=plist.

Diff Detail

Szelethus created this revision.Sat, Apr 7, 1:34 PM
NoQ added a subscriber: NoQ.Sat, Apr 7, 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.Sat, Apr 7, 4:16 PM

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

NoQ added a comment.Fri, Apr 13, 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.EditedMon, Apr 16, 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.Fri, Apr 20, 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.Fri, Apr 20, 2:06 PM