[PATCH] D97874: [analyzer] Improve SVal cast from integer to bool using known RangeSet

Denys Petrov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 5 11:21:02 PST 2021


ASDenysPetrov added a comment.

@NoQ Thanks for your comment.



================
Comment at: clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:877-879
+      std::tie(IsZero, IsNotZero) =
+          getStateManager().getConstraintManager().isSymValWithinOrOutsideRange(
+              State, SE, Zero, Zero);
----------------
NoQ wrote:
> What was wrong with `State->assume(V)`? Why make a new function? Is this for optimization only?
Yes, it's created just for avoiding unnecessary work. You are right. I found an appropriate function `ProgramState::isNull`. I'll replace by it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97874/new/

https://reviews.llvm.org/D97874



More information about the cfe-commits mailing list