[PATCH] D52957: [analyzer] Teach CallEvent about C++17 aligned new.

2020-11-09 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. In D52957#2383373 , @steakhal wrote: > In D52957#2379330 , @NoQ wrote: > >> The argument value can be computed by taking the size of the type (and >> aligning to the requested alignment, i gues

[PATCH] D52957: [analyzer] Teach CallEvent about C++17 aligned new.

2020-11-09 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D52957#2379330 , @NoQ wrote: > You cannot have an argument expression because there's no argument expression > anywhere in the AST. There's an argument, but it's not computed as a value of > any syntactic expression. If there

[PATCH] D52957: [analyzer] Teach CallEvent about C++17 aligned new.

2020-11-06 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. You cannot have an argument expression because there's no argument expression anywhere in the AST. There's an argument, but it's not computed as a value of any syntactic expression. If there was no argument, `getArgExpr(0)` would have crashed; but it returns a `nullptr` whi

[PATCH] D52957: [analyzer] Teach CallEvent about C++17 aligned new.

2020-11-06 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D52957#2377914 , @NoQ wrote: > Everything looks good to me here. The new-expression `new int;` has 1 > implicit argument (allocation size passed to the implementation of operator > new, the value is probably 4) and 0 placemen

[PATCH] D52957: [analyzer] Teach CallEvent about C++17 aligned new.

2020-11-05 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Everything looks good to me here. The new-expression `new int;` has 1 implicit argument (allocation size passed to the implementation of operator new, the value is probably 4) and 0 placement arguments (the ones that are explicitly written down after `new` and before `int`)

[PATCH] D52957: [analyzer] Teach CallEvent about C++17 aligned new.

2020-11-04 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Herald added subscribers: ASDenysPetrov, martong, Charusso, dkrupp. I'm not sure if this implementation is correct. I'm expecting this checker code not to crash: const auto *alloc = dyn_cast(&Call); if (!alloc) return; const int NumImpArgs = alloc->getNumIm

[PATCH] D52957: [analyzer] Teach CallEvent about C++17 aligned new.

2018-10-15 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Whoops, almost forgot to doxygen-ize comments. Landed in https://reviews.llvm.org/rC344540. Repository: rL LLVM https://reviews.llvm.org/D52957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cg

[PATCH] D52957: [analyzer] Teach CallEvent about C++17 aligned new.

2018-10-15 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344539: [analyzer] Teach CallEvent about C++17 aligned operator new(). (authored by dergachev, committed by ). Herald added subscribers: llvm-commits, donat.nagy. Changed prior to commit: https://review

[PATCH] D52957: [analyzer] Teach CallEvent about C++17 aligned new.

2018-10-08 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. LGTM! I agree that it would make sense to either not have arguments that are not represented in the AST or create expressions for those implicit arguments. Repository: rC Clang htt

[PATCH] D52957: [analyzer] Teach CallEvent about C++17 aligned new.

2018-10-06 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:929 + // number of arguments is always the same as the number of parameters. + unsigned getNumImplicitArgs() const { +return getOriginExpr()->passAlignment() ? 2 : 1; --

[PATCH] D52957: [analyzer] Teach CallEvent about C++17 aligned new.

2018-10-05 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ created this revision. NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet, rnkovacs. Herald added subscribers: cfe-commits, Szelethus, mikhail.ramalho, baloghadamsoftware. In C++17, when class `C` has large alignment value, a special case of overload resolution r