[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

Samira Bazuzi via cfe-commits cfe-commits at lists.llvm.org
Fri May 10 08:07:23 PDT 2024


bazuzi wrote:

I agree with the usefulness of storing the initial target separately, reducing checks and branching based on whether the current target is a `Stmt` or `Function`. Since I was touching everywhere `CallStack` was used anyway, I went ahead with not pushing the starting `FunctionDecl` onto that stack.

I wasn't immediately able to reduce the `initialize` duplication for statements and function bodies since `buildResultObjectMap` and `initFieldsGlobalsAndFuncs`, via `getReferencedDecls`, both handle `FunctionDecl`s and `Stmt`s differently, pulling info from a `FunctionDecl` beyond just its body. If templating `initFieldsGlobalsAndFuncs` is really undesirable, I could either pass in the `ReferencedDecls` from current callers or insert an intermediate with two overloads that takes the `Stmt`/`FunctionDecl` and passes along the `ReferencedDecls`.

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


More information about the cfe-commits mailing list