[clang] [Clang][analyzer] replace Stmt* with ConstCFGElementRef in SymbolConjured (PR #128251)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 24 08:02:54 PDT 2025


================
@@ -2556,10 +2556,19 @@ void ExprEngine::processCFGBlockEntrance(const BlockEdge &L,
     const Stmt *Term = nodeBuilder.getContext().getBlock()->getTerminatorStmt();
     if (!isa_and_nonnull<ForStmt, WhileStmt, DoStmt, CXXForRangeStmt>(Term))
       return;
+
+    // FIXME:
----------------
steakhal wrote:

Now thinking about this, and looking at the assertion within `getWidenedLoopState` we don't actually need to assert that the wrapped Stmt is a loop statement. As for correctness, it might be surprising to hear but it also doesn't really matter what CFGElement we would pass, the important part to pass something, and do so deterministically.

So if it makes the code simpler, we can drop the assertion inside, and even pass the wrong CFGElement here.
Would it make the patch simpler?

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


More information about the cfe-commits mailing list