[PATCH] D105436: [analyzer][solver] Use all sources of constraints

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 6 01:40:06 PDT 2021


martong added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:908
+        // into subexpressions of Sym.
+        Visit(Sym));
   }
----------------
Alright. So, this is correct because `Visit` boils down finally to either `infer(Sym->getType)` or to `VisitBinaryOperator`. And both of them do a correct over-approximation of the ranges. Please confirm. 

First, I was a bit concerned b/c it is not immediate and not documented here. And it is easy to think by the first look that this might be faulty if we take the approximation of one operand of a binop that might not be true for the whole binop expression. Again, that is not the case because we approximate only in case of such ops where we can do a correct over-approximation (i.e. `|`, `&` and `%`). 

My point is, I'd like to see more explanatory comments here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105436



More information about the cfe-commits mailing list