[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)
via cfe-commits
cfe-commits at lists.llvm.org
Wed May 15 01:07:33 PDT 2024
================
@@ -736,11 +756,20 @@ class Environment {
// shared between environments in the same call.
// https://github.com/llvm/llvm-project/issues/59005
- // `DeclContext` of the block being analysed if provided.
- std::vector<const DeclContext *> CallStack;
+ // The stack of functions called from the initial analysis target and
+ // recursively being analyzed.
+ std::vector<const FunctionDecl *> CallStack;
+
+ // If the initial analysis target is a function, this is the function
+ // declaration. Otherwise, this is null.
+ const FunctionDecl *InitialTargetFunc = nullptr;
+ // If the initial analysis target is a function, this is its body. If the
+ // initial analysis target was not provided, this is null. Otherwise, this is
+ // the initial analysis target.
----------------
martinboehme wrote:
Similarly:
```suggestion
// Top-level statement of the initial analysis target.
// If a function was passed to the constructor, this is its body.
// If a statement was passed to the constructor, this is that statement.
// Null if no analysis target was passed to the constructor.
```
https://github.com/llvm/llvm-project/pull/91616
More information about the cfe-commits
mailing list