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

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 22 05:12:34 PDT 2026


================
@@ -64,7 +64,12 @@ void UndefBranchChecker::checkBranchCondition(const Stmt *Condition,
   // ObjCForCollection is a loop, but has no actual condition.
   if (isa<ObjCForCollectionStmt>(Condition))
----------------
NagyDonat wrote:

I would support changing the type of the parameter of the `checkBranchCondition` callback to ensure that it recieves an `Expr` (instead of a `Stmt`). (This way `ObjCForCollectionStmt` would not trigger this checker callback, which is entirely fair because that for collection loop _does not have a real branch condition_.)

However I would prefer placing this change into a separate PR because it affects the checker API and this PR is large enough even without it.

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


More information about the cfe-commits mailing list