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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits