This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Extend NoStoreFuncVisitor to insert a note on IVars
ClosedPublic

Authored by george.karpenkov on Jul 23 2018, 11:45 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ added inline comments.Jul 23 2018, 5:28 PM
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
330 ↗(On Diff #156849)

Shouldn't it say self->? Dot is kinda property syntax (?)

391–396 ↗(On Diff #156849)

Wouldn't ObjCIvarRegion::getDecl() be sufficient?

409–410 ↗(On Diff #156849)

I think we traditionally run a statement matcher on a Decl->getBody(), but i guess it doens't really matter. Just kinda nice to know that we're dealing with statements only and that we could have used a StmtVisitor (as compared to a much more complicated RecursiveASTVisitor) instead.

clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
330 ↗(On Diff #156849)

that's how you refer to ivars in Objective-C.

391–396 ↗(On Diff #156849)

which line and which operation does this comment refer to?

409–410 ↗(On Diff #156849)

yeah could be replaced with a StatementVisitor

NoQ added inline comments.Jul 23 2018, 5:49 PM
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
391–396 ↗(On Diff #156849)

Replace the whole loop, and maybe more code around it, with some sort of dyn_cast<ObjCIvarRegion>(RegionOfInterest)->getDecl().

george.karpenkov marked 3 inline comments as done.
NoQ accepted this revision.Jul 24 2018, 4:02 PM
NoQ added inline comments.
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
321–323 ↗(On Diff #157152)

I aim to eliminate this idiom, but i'm definitely not there yet.

456–457 ↗(On Diff #157152)

That's a lot of parameters that would look better as member variables. I think we should just put an ASTContext reference into the visitor (not include it in Profile) instead of passing it around.

This revision is now accepted and ready to land.Jul 24 2018, 4:02 PM
This revision was automatically updated to reflect the committed changes.
george.karpenkov reopened this revision.Jul 26 2018, 7:20 PM

Reopening as had to revert due to uncommitted dependency.

clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
330 ↗(On Diff #156849)

ooops I was wrong.

This revision is now accepted and ready to land.Jul 26 2018, 7:20 PM
This revision was automatically updated to reflect the committed changes.