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

Fangyi Zhou via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 23 10:50:38 PDT 2025


================
@@ -645,6 +645,7 @@ struct StreamOperationEvaluator {
   SymbolRef StreamSym = nullptr;
   const StreamState *SS = nullptr;
   const CallExpr *CE = nullptr;
+  std::optional<CFGBlock::ConstCFGElementRef> ElemRef;
----------------
fangyi-zhou wrote:

I'm not entirely sure whether I get your point correctly. This value needs to be stored when `Init` is called, and used in other calls (e.g. `bindReturnValue`). The reason why this is declared as an optional is that there is no default constructor for `ConstCFGElementRef`, so I used an optional to give an absent value (I guess it could have been a pointer like other ones)

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


More information about the cfe-commits mailing list