[PATCH] D110357: [Analyzer] Extend ConstraintAssignor to handle remainder op

Denys Petrov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 12 08:29:47 PDT 2021


ASDenysPetrov added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1609-1612
+      const SymExpr *LHS = Sym->getLHS();
+      const llvm::APSInt &Zero =
+          Builder.getBasicValueFactory().getValue(0, LHS->getType());
+      State = RCM->assumeSymNE(State, LHS, Zero, Zero);
----------------
martong wrote:
> steakhal wrote:
> > ASDenysPetrov wrote:
> > > Maybe make some more complex assumptions to cover complex **LHS's**?
> > Oh nice.
> `State->assume` goes through many higher level abstractions and finally calls `assumeSymNE`, so I think calling that would be a pessimization in this case.
I agree, but then you lose an internal simplification of LHS symbol.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110357



More information about the cfe-commits mailing list