[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

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


xazax.hun added a comment.

Are you sure this works as intended when e.g.: `$a+2==$b*3`
So on one of the sides, the ops are not additive?
I would like to see some test cases for that.



================
Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:572
+              lInt = &lSymIntExpr->getRHS();
+              Sym = lSymIntExpr->getLHS();
+            }
----------------
Is overwriting Sym a good idea here? Maybe it will be harder to maintain this code if the same variable can refer to different symbols all the time. 


================
Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:623
+          } else {
+            if (reverse) {
+              op = BinaryOperator::reverseComparisonOp(op);
----------------
In LLVM we usually do not add braces for single statement blocks. 


https://reviews.llvm.org/D35109





More information about the cfe-commits mailing list