[clang] [NFC][analyzer] Spread use of 'Expr*' instead of 'Stmt*' (PR #188319)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 30 02:54:14 PDT 2026


================
@@ -397,15 +397,15 @@ class LocationContextManager {
   ///
   /// \param ADC        The AnalysisDeclContext.
   /// \param ParentLC   The parent context of this newly created context.
-  /// \param S          The call.
+  /// \param E          The call expression.
   /// \param Block      The basic block.
-  /// \param BlockCount The current count of entering into \p Blk.
-  /// \param Index      The index of \p Blk.
-  /// \returns The context for \p D with parent context \p ParentLC.
+  /// \param BlockCount The current count of entering into \p Block.
+  /// \param StmtIdx    The index of the call expression within \p Block.
----------------
NagyDonat wrote:

Good catch that this is confusing. I intend to keep the variable name `StmtIdx`, but I update the explanation to "The index of the call expression `\p E` among the statements of the CFGBlock `\p Block`."

The `Block` has a list of statements, which contains `E` (an expression), but often contains non-expression statements as well, so `ExprIdx` would be inaccurate. Also, `StmtIdx` is already used to mean "the index of a statement within a `CFGBlock`" e.g. in `ExprEngine::currStmtIdx` and IIRC in other places as well.

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


More information about the cfe-commits mailing list