[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-06 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb29186c08ae2: [analyzer] canonicalize special case of structure/pointer deref (authored by vabridgers, committed by einvbri ). Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-06 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. It looks great. Thanks Vince! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 ___ cfe-commits mailing

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-05 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers updated this revision to Diff 377309. vabridgers added a comment. This revision is now accepted and ready to land. Refactor compare a little bit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-05 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers planned changes to this revision. vabridgers added a comment. I'm refactoring the code change a bit. I'll push another update soon. Thanks for the comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-01 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers updated this revision to Diff 376526. vabridgers added a comment. Use canonical types for comparison Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 Files: clang/lib/StaticAnalyzer/Core/Store

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D110625#3035974 , @ASDenysPetrov wrote: > In D110625#3035929 , @steakhal > wrote: > >> I thought that `SVal::getType` should return an already canonical >> `QualType`. If it doesn't

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-01 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D110625#3035929 , @steakhal wrote: > I thought that `SVal::getType` should return an already canonical `QualType`. > If it doesn't do that we would need to do canonicalization at each callsite, > which is less than idea

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-01 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D110625#3035843 , @ASDenysPetrov wrote: > In D110625#3035616 , @steakhal > wrote: > >> WDYT Denys? Btw does the SVval::getType return a canonical type in all cases? > > `SVal::getTyp

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-01 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers added a comment. I moved the test cases from ptr-arith.cpp to ptr-arith - using to typedef, and created an extra test case that uses const. I believe this may address all concerns discussed thus far? Please let me know if we need anything more and I'll get it done. Best! Repository

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-01 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers updated this revision to Diff 376453. vabridgers added a comment. add const test case Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 Files: clang/lib/StaticAnalyzer/Core/Store.cpp clang/te

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-01 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers updated this revision to Diff 376452. vabridgers added a comment. move test case from cpp file to c file Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 Files: clang/lib/StaticAnalyzer/Core/S

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-01 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers updated this revision to Diff 376450. vabridgers added a comment. added typedef case to C file for comparison, discussion Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 Files: clang/lib/Stat

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-10-01 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D110625#3035616 , @steakhal wrote: > 'using' is the same as 'typedef' AFAIK. > So, you could simply use only typedefs and implement the test in the c test > file. Seeing all the tests close together would aid readability

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-30 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. 'using' is the same as 'typedef' AFAIK. So, you could simply use only typedefs and implement the test in the c test file. Seeing all the tests close together would aid readability IMO. WDYT Denys? Btw does the SVval::getType return a canonical type in all cases? Reposi

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-30 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers added a comment. @ASDenysPetrov , thank you for the comment. I added a test case per your suggestion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 __

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-30 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers updated this revision to Diff 376374. vabridgers added a comment. update per comments from Denys Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 Files: clang/lib/StaticAnalyzer/Core/Store.cpp

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-30 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. I think we need to get canonical types. Check, please, aliased types: struct s { int v; }; using T1 = s; typedef s T2; void foo(T1 *ps) { T2 ss = *ps; ... } Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-29 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers marked 3 inline comments as done. vabridgers added a comment. Thanks @steakhal and @martong for the comments! The patch has been updated. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 ___

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-29 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers updated this revision to Diff 375810. vabridgers added a comment. updates per @steakhal comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 Files: clang/lib/StaticAnalyzer/Core/Store.cpp

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-29 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. nits Comment at: clang/test/Analysis/ptr-arith.c:336 + int v; + char y; +}; It's probably unnecessary. Comment at: clang/test/Analysis/ptr-arith.c:339 + +void clang_analyzer_dump(int); + I would pr

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-28 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers updated this revision to Diff 375727. vabridgers added a comment. improve test cases per @martong Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 Files: clang/lib/StaticAnalyzer/Core/Store.cp

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-28 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers added a comment. @martong, Thanks for yes for sure! I'll post an update soon with a few minor test improvements. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 ___

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks Vince! Nice work! Do you think it would be worth to have a test that checks the equality of a double pointer and a bi-dimensional array? Something like: void struct_pointer_canon(struct s **ps) { struct s ss = **ps; clang_analyzer_eval(&(ps[0][0].v) ==

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-28 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers updated this revision to Diff 375640. vabridgers added a comment. update test case Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 Files: clang/lib/StaticAnalyzer/Core/Store.cpp clang/test/

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-28 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers planned changes to this revision. vabridgers added a comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.llvm.org/D110625 ___ cfe-commits mailing list cfe-commi

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-28 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers added a comment. Just an initial push to get this patch out there for review. I think this is pretty close. Thanks @steakhal and @martong for the debug session! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110625/new/ https://reviews.l

[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref

2021-09-28 Thread Vince Bridgers via Phabricator via cfe-commits
vabridgers created this revision. vabridgers added reviewers: steakhal, martong. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. vabridgers requested review of this revision. He