[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 11 02:36:45 PDT 2017


xazax.hun added inline comments.


================
Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:500
+      // If the type of A - B is the same as the type of A, then use the type of
+      // B as the type of B - A. Otherwise keep the type of A - B.
+      SymbolRef negSym = SymMgr.getSymSymExpr(SSE->getRHS(), BO_Sub,
----------------
Could you give an example why do you need this (probably as a test), or constrain the transformation when all the types are the same?


================
Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:507
+          State->get<ConstraintRange>(negSym)) {
+        // Do not negate an unsigned range set, unless it is [0, 0].
+        if((negV->getConcreteValue() &&
----------------
I think it would be better to describe why don't we want to do that rather than describing what the code does. 


https://reviews.llvm.org/D35110





More information about the cfe-commits mailing list