[PATCH] D113753: [Analyzer][Core] Better simplification in SimpleSValBuilder::evalBinOpNN

Bal√°zs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 12 06:06:56 PST 2021


steakhal added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:378
+  SVal simplifiedLhs = simplifySVal(state, lhs);
+  SVal simplifiedRhs = simplifySVal(state, rhs);
+  if (auto simplifiedLhsAsNonLoc = simplifiedLhs.getAs<NonLoc>())
----------------
It seems like you simplify the `rhs` as well. Could we have a test for that?


================
Comment at: clang/test/Analysis/svalbuilder-simplify-in-evalbinop.cpp:13
+void test_evalBinOp_simplifies(int x, int y) {
+  x = y / 77;
+  if (y != 77)
----------------
Please declare `x` in this statement.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113753



More information about the cfe-commits mailing list