[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions

2022-04-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 423813. ASDenysPetrov added a comment. Loaded with comment updateds according to the remarks. @martong thank you for your time for the review! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103094/new/ https://reviews.llvm.org/D103094 Files:

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions

2022-04-19 Thread Denys Petrov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe37726beb22a: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions… (authored by ASDenysPetrov). Changed prior to

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions

2022-04-19 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Thanks, LGTM! With minor revisions. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:749 +// E.g. char{1,3,5,127} -> uint{1,3,5,127} +// Interrupt the

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions

2022-04-15 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 423080. ASDenysPetrov added a comment. Updated according to suggestions. @martong thank you for the review. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103094/new/ https://reviews.llvm.org/D103094 Files:

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions

2022-04-15 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:358 + assert(!isEmpty()); + return begin()->From().isUnsigned(); +} martong wrote: > Probably it is unrelated to this patch, but > Could it happen that

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions

2022-04-13 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks for you patience Denys! Finally I had some time for the review. Nice work! Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h:242 +/// +/// This function optimized for each of the six cast

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions

2022-03-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103094#3403075 , @ASDenysPetrov wrote: > Ping. I am still interested in this! I am sorry for being inactive with it lately, I hope I'll have time soon to continue the review of this patch stack. CHANGES SINCE LAST ACTION

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions

2022-03-23 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Herald added a project: All. Ping. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103094/new/ https://reviews.llvm.org/D103094 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions

2021-11-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 388512. ASDenysPetrov added a comment. Fixed missed part during rebasing in the unit test. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103094/new/ https://reviews.llvm.org/D103094 Files:

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions

2021-11-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 388481. ASDenysPetrov added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103094/new/ https://reviews.llvm.org/D103094 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

2021-09-22 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 374267. ASDenysPetrov added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103094/new/ https://reviews.llvm.org/D103094 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

2021-07-14 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 358661. ASDenysPetrov added a comment. Rebased CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103094/new/ https://reviews.llvm.org/D103094 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

2021-06-24 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 354225. ASDenysPetrov added a comment. Added assertions. Added two helper functions for `castTo` method. Moved some distinct code to them. Fixed clang-tidy complaints. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103094/new/

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

2021-06-23 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. I'll update tommorow. Comment at: clang/unittests/StaticAnalyzer/RangeSetTest.cpp:120 + + template const llvm::APSInt (T X) { +static llvm::APSInt Int = APSIntTy.getZeroValue(); vsavchenko wrote: > Default to `BaseType`?

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

2021-06-23 Thread Valeriy Savchenko via Phabricator via cfe-commits
vsavchenko added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:297-307 +bool clang::ento::RangeSet::isUnsigned() const { + return begin()->From().isUnsigned(); +} + +uint32_t clang::ento::RangeSet::getBitWidth() const { + return

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

2021-06-23 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 353954. ASDenysPetrov added a comment. Made changes according to comments. Optimized `castTo` function for each cast case. Simplified unit test. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103094/new/ https://reviews.llvm.org/D103094

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

2021-06-17 Thread Valeriy Savchenko via Phabricator via cfe-commits
vsavchenko added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:692 + ContainerType Result; + ContainerType RHS; + ASDenysPetrov wrote: > vsavchenko wrote: > > We have LHS (left-hand side) and RHS (right-hand side) as a

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

2021-06-17 Thread Valeriy Savchenko via Phabricator via cfe-commits
vsavchenko added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h:245-246 +/// +/// Complexity: O(N^2) +/// where N = size(What) +RangeSet castTo(RangeSet What, APSIntType Ty);

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

2021-06-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h:245-246 +/// +/// Complexity: O(N^2) +/// where N = size(What) +RangeSet castTo(RangeSet What, APSIntType Ty);

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

2021-06-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @vsavchenko Repled in inlines. Preparing an update. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h:245-246 +/// +/// Complexity: O(N^2) +/// where N = size(What) +RangeSet

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

2021-06-17 Thread Valeriy Savchenko via Phabricator via cfe-commits
vsavchenko added a comment. OK, about the quadratic algorithm. I can think of one solution that is actually linear asymptotically, but because of the constant factor can be worse in practice (we usually have extremely small range sets). So, while I don't like it, it's probably fine.

[PATCH] D103094: [analyzer] Implemented RangeSet::Factory::castTo function to perform promotions, truncations and conversions.

2021-05-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: vsavchenko, NoQ, steakhal, xazax.hun. ASDenysPetrov added a project: clang. Herald added subscribers: manas, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. ASDenysPetrov