This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] [RetainCountChecker] Smart pointer support.
ClosedPublic

Authored by george.karpenkov on Jan 16 2019, 3:21 PM.

Diff Detail

Event Timeline

NoQ added a comment.Jan 16 2019, 3:31 PM

Maybe put these new headers into Inputs where other system header simulators already belong?

clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp
533–535

I think it should be safe to unconditionally cast<> here. I doubt you'll ever try to apply this function to a memory space, even accidentally.

So i guess you can actually collapse all these casts into a single line of code.

1177

shouldEscapeRegion(MR) currently implies !isSmartPtrField(MR).

clang/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp
209

I suspect that this may crash when RD is an anonymous class. getNameAsString() should be safer.

george.karpenkov marked 3 inline comments as done.Jan 17 2019, 1:07 PM

Addressed comments. Not sure about Inputs: plenty of headers are in the root directory.

george.karpenkov updated this revision to Diff 182383.
NoQ accepted this revision.Jan 17 2019, 2:43 PM

Ok!

This revision is now accepted and ready to land.Jan 17 2019, 2:43 PM
This revision was automatically updated to reflect the committed changes.