This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Add docs for cplusplus.InnerPointer
ClosedPublic

Authored by Szelethus on Apr 4 2019, 12:24 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

rnkovacs created this revision.Apr 4 2019, 12:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2019, 12:24 PM
Szelethus accepted this revision.Apr 7 2019, 11:09 AM

Woohoo!

docs/analyzer/checkers.rst
225–226 ↗(On Diff #193762)

Hmm. While this page is a documentation, I would still expect regular users to browse through it -- are we sure that we want to add future plans for a non-alpha checker? I'm not against it, just a question.

This revision is now accepted and ready to land.Apr 7 2019, 11:09 AM
dkrupp added inline comments.Apr 8 2019, 12:02 AM
docs/analyzer/checkers.rst
225–226 ↗(On Diff #193762)

I think it is a good idea. A non-alpha checker can also be further developed, by anyone else. It is good that we don't forget about further features. This note also highlights the limitations of the checker.

Szelethus added inline comments.Apr 10 2019, 3:00 PM
docs/analyzer/checkers.rst
225–226 ↗(On Diff #193762)

How about this: "Future plans include to add support for blahblah". The current statement should rather be a TODO in the code.

NoQ added inline comments.Apr 12 2019, 6:20 PM
docs/analyzer/checkers.rst
225–226 ↗(On Diff #193762)

I suggest presenting it as "The checker is currently limited to std::strings and doesn't recognize some of the more sophisticated approaches to passing unowned pointers around, such as std::string_views". It sounds a bit more negative than it deserves to sound, but that's the most documentation-like text i managed to come up with so far >.< Maybe put it under a "Known Limitations:" marker and/or expand the main part of the documentation in order to keep the reader's impression balanced, eg. "Many container methods in the C++ standard library are known to invalidate "references" (including actual references, iterators and raw pointers) to elements of the container. Using such references after they are invalidated causes undefined behavior, which is a common source of memory errors in C++ that this checker is capable of finding."

While this page is a documentation, I would still expect regular users to browse through it

I'd love our users to browse it! Maybe we should consider adding a documentation link to our HTML report headers as the documentation gets good enough.

232 ↗(On Diff #193762)

The test_ part doesn't add much here, maybe drop it?

Szelethus commandeered this revision.Aug 14 2019, 2:35 PM
Szelethus edited reviewers, added: rnkovacs; removed: Szelethus.

I'll gladly add the finishing touches :)

This revision now requires review to proceed.Aug 14 2019, 2:35 PM

I'll gladly add the finishing touches :)

So sorry for leaving this hanging!
Thanks Husi, you da best :)

Szelethus updated this revision to Diff 215281.Aug 14 2019, 4:29 PM
Szelethus changed the repository for this revision from rC Clang to rG LLVM Github Monorepo.

Revised the documentation according to @NoQ's comments. By literally copy pasting it. Like any good programmer should do :^)

NoQ added inline comments.Aug 14 2019, 4:33 PM
clang/docs/analyzer/checkers.rst
263 ↗(On Diff #215281)

I suggest deref_after_assignment.

271 ↗(On Diff #215281)

Let's turn this into a parameter so that to avoid an uninitialized use (and generally be more realistic).

Szelethus updated this revision to Diff 215288.Aug 14 2019, 5:06 PM
Szelethus marked 2 inline comments as done.

Fixed!

NoQ accepted this revision.Aug 14 2019, 5:10 PM

Thanks!

One more quick question: Who is Husi???

clang/docs/analyzer/checkers.rst
261 ↗(On Diff #215288)

This declaration doesn't add much to the documentation, feel free to remove it :)

This revision is now accepted and ready to land.Aug 14 2019, 5:10 PM
In D60281#1630646, @NoQ wrote:

Thanks!

One more quick question: Who is Husi???

Well thats me. Long story short, the reason why my name is Szelethus is that my first ever character to hit max level in World of Warcraft was called Szelethús. It literally means "slice of meat" in Hungarian. When I got to university, we were instructed to pick a nickname at the beginning of the freshman camp, where the shorthand version "Husi" ("meat", pronounced along the lines of "hushie") was born, and stuck on me ever since. So aside from my parents, I'm universally called that, even in the office.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2019, 1:53 AM