[clang] [NFC][analyzer] Refactor Environment to map Expr to SVal instead of Stmt to SVal (PR #193295)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 21 12:48:49 PDT 2026


================
@@ -792,22 +792,18 @@ inline SVal ProgramState::getLValue(QualType ElementType, SVal Idx, SVal Base) c
   return UnknownVal();
 }
 
-inline SVal ProgramState::getSVal(const Stmt *Ex,
+inline SVal ProgramState::getSVal(const Expr *Ex,
----------------
steakhal wrote:

Some notes about variable names. This is not directly applicable here, I'm just sharing my opinion.
Basically, if a variable of type `Stmt` was called `S` or `St` - then that must be renamed because it would be confusing for Exprs.
However, if the variable name is "ok" just weird, like `Ex`, then we should keep that.
Otherwise I'd prefer `E` as the canonical way of calling Exprs where it's not ambiguous.

Here in this hunk, `Ex` is "ok" and shouldn't be changed.

https://github.com/llvm/llvm-project/pull/193295


More information about the cfe-commits mailing list