[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2018-01-17 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC322787: [analyzer] operator new: Add a new checker callback, check::NewAllocator. (authored by dergachev, committed by ). Changed prior to commit: https://reviews.llvm.org/D41406?vs=129369&id=130304#toc

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2018-01-10 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 129369. NoQ added a comment. Rebase (getter rename). https://reviews.llvm.org/D41406 Files: include/clang/StaticAnalyzer/Core/Checker.h include/clang/StaticAnalyzer/Core/CheckerManager.h lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp lib/StaticAna

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2018-01-09 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. In https://reviews.llvm.org/D41406#970985, @xazax.hun wrote: > Do you have a plan for the new false negatives when `c++-allocator-inlining` > is on? Should the user mark allocation functions with attributes? Not immediately - the immediate plan is to simply believe that we

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2018-01-09 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 129214. NoQ marked 6 inline comments as done. NoQ added a comment. Address review comments. Stick to the callback approach for now. https://reviews.llvm.org/D41406 Files: include/clang/StaticAnalyzer/Core/Checker.h include/clang/StaticAnalyzer/Core/CheckerM

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2018-01-09 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: include/clang/StaticAnalyzer/Core/CheckerManager.h:311 + ExprEngine &Eng, + bool wasInlined = false); + dcoughlin wrote: > Does 'wasInlined' really need to ha

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2018-01-09 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. But still, i guess, it is also easier for checker authors to discover a checker callback (it's right there in the `CheckerDocumentation`, which is short enough to read fully) than to discover a `CallEvent` sub-class (which was so hard that i never discovered it until like n

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2018-01-09 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. > Like, make a new `CallEvent` sub-class called, say, `CXXNewAllocatorCall` Oh, we already have it (`CXXAllocatorCall`). https://reviews.llvm.org/D41406 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2018-01-09 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. > which would re-evaluate the cast and return the casted object Rather not. Because i'm changing my mind again about avoiding the redundant cast in `&element{T, HeapSymRegion{conj}}` - this time by not calling `evalCast` after a conservatively evaluated operator new call (t

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2018-01-09 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. In https://reviews.llvm.org/D41406#970985, @xazax.hun wrote: > Also, I was wondering if it would make sense to only have the PostCall > callback return the casted memory region in these specific cases instead of > introducing a new callback. Yep, i actually think it's a v

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2018-01-09 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Do you have a plan for the new false negatives when `c++-allocator-inlining` is on? Should the user mark allocation functions with attributes? Also, I was wondering if it would make sense to only have the PostCall callback return the casted memory region in these spec

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2018-01-08 Thread Devin Coughlin via Phabricator via cfe-commits
dcoughlin accepted this revision. dcoughlin added a comment. This revision is now accepted and ready to land. Looks good to me with some minor nits inside (and also a request to consider factoring out common code). Comment at: include/clang/StaticAnalyzer/Core/CheckerManager.h

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2017-12-20 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. In https://reviews.llvm.org/D41406#960824, @xazax.hun wrote: > Maybe `debug.AnalysisOrder` could be used to test the callback order > explicitly. This way the test could also serve as a documentation for the > callback order. Yep, totally, will do. https://reviews.llvm.

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2017-12-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. Maybe `debug.AnalysisOrder` could be used to test the callback order explicitly. This way the test could also serve as a documentation for the callback order. https://reviews.llvm.org/D41406 ___ cfe-commits mailing list

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2017-12-19 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. TODOs for the future commits: - Constructor shouldn't cause pointer escape of the newly allocated pointer immediately after the NewAllocator callback, otherwise we ain't gonna find no leaks. Without `c++-allocator-inlining`, we only started tracking the pointer after the c

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2017-12-19 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 127579. NoQ added a comment. - Actually call the new callback when the allocator call is inlined. - Update checker documentation :) https://reviews.llvm.org/D41406 Files: include/clang/StaticAnalyzer/Core/Checker.h include/clang/StaticAnalyzer/Core/CheckerM

[PATCH] D41406: [analyzer] Add a new checker callback, check::NewAllocator.

2017-12-19 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ created this revision. NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet. Herald added a subscriber: rnkovacs. This patch is roughly based on the discussion we've had in http://lists.llvm.org/pipermail/cfe-dev/2017-December/056314.html about how our support for C