[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-25 Thread Denys Petrov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3b1165ba3d15: [analyzer] Retrieve incomplete array extent from its redeclaration. (authored by ASDenysPetrov). Changed prior to commit: https://reviews.llvm.org/D111542?vs=381252&id=381944#toc Reposito

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1654 + // NOTE: If `Init` is non-null, then a new `VD` is non-null for sure. So check + // `Init` for null only and don't worry about the replaced `VD`. if (!Init) ---

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-25 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. Minor nits. Aside from that just land it. Thanks for the fix. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1654 + // NOTE: If `Init` is non-null, then a new `VD` is non-null for sure. So check + // `Init

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-21 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 381252. ASDenysPetrov added a comment. Rebased. Updated comment for obscure behaviour of `getAnyInitializer` function. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111542/new/ https://reviews.llvm.org/D111542 Files: clang/lib/StaticAnalyze

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-21 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1649-1653 + // NOTE: `VD` is always non-null if `Init` is non-null, so we can check for + // null only one of them. + const Expr *Init = VD->getAnyInitializer(VD); if (!Init)

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-20 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. In D111542#3074926 , @ASDenysPetrov wrote: > Updated according to the latest suggestions. > @martong I think now this patch is way more simple and clear than before. Thanks, indeed! LGTM (with nit

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-20 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1649-1653 + // NOTE: `VD` is always non-null if `Init` is non-null, so we can check for + // null only one of them. + const Expr *Init = VD->getAnyInitializer(VD); if (!Init) retu

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-20 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 380936. ASDenysPetrov added a comment. Fixed redefinition in test file initialization.cpp. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111542/new/ https://reviews.llvm.org/D111542 Files: clang/lib/StaticAnalyzer/Core/RegionStore.cpp cla

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-20 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D111542#3073709 , @NoQ wrote: > Amazing, thanks a lot! Thank you, @NoQ, for the acceptance. I got some fresher update. And, of course in order to load it, we should accept a parent revision D106681

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-20 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 380910. ASDenysPetrov added a comment. Updated according to the latest suggestions. @martong I think now this patch is way more simple and clear than before. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111542/new/ https://reviews.llvm.org/D1

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-19 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. Amazing, thanks a lot! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111542/new/ https://reviews.llvm.org/D111542 ___ cfe-commits mailing list c

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-18 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 380518. ASDenysPetrov added a comment. Rebased on top of D106681 . CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111542/new/ https://reviews.llvm.org/D111542 Files: clang/lib/StaticAnalyzer/Core/RegionStore

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-15 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1669-1711 // The array index has to be known. if (auto CI = R->getIndex().getAs()) { -// If it is not an array, return Undef. -QualType T =

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-13 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1669-1711 // The array index has to be known. if (auto CI = R->getIndex().getAs()) { -// If it is not an array, return Undef. -QualType T = VD->g

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-12 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/test/Analysis/initialization.c:101-102 + +const int glob_arr3[]; // Incomplete array declaration +const int glob_arr3[4] = {1, 2, 3}; // Incomplete Array redeclaration +void foo() { ASDenysPetrov wrot

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-12 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1661-1663 // Check if the containing array has an initialized value that we can trust. // We can trust a const value or a value of a global initializer in main(). +const

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1663 // We can trust a const value or a value of a global initializer in main(). -const VarDecl *VD = VR->getDecl(); +const VarDecl *VD = VR->getDecl()->getMostRecentDecl();

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-12 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1663 // We can trust a const value or a value of a global initializer in main(). -const VarDecl *VD = VR->getDecl(); +const VarDecl *VD = VR->getDecl()->getMostRecentDecl()

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-11 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1663 // We can trust a const value or a value of a global initializer in main(). -const VarDecl *VD = VR->getDecl(); +const VarDecl *VD = VR->getDecl()->getMostRecentDecl(); if

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-11 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/test/Analysis/initialization.c:102 +const int glob_arr3[]; // Incomplete array declaration +const int glob_arr3[4] = {1, 2, 3}; // Incomplete Array redeclaration +void foo() { It is possible to add a

[PATCH] D111542: [analyzer] Retrieve incomplete array extent from its redeclaration.

2021-10-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 378684. ASDenysPetrov retitled this revision from "[analyzer] Retrieve VLA extent from its redeclaration." to "[analyzer] Retrieve incomplete array extent from its redeclaration.". ASDenysPetrov edited the summary of this revision. CHANGES SINCE LAST A