================
@@ -641,23 +656,20 @@ class Environment {
/// (or the flow condition is overly constraining) or if the solver times
out.
bool allows(const Formula &) const;
- /// Returns the `DeclContext` of the block being analysed, if any. Otherwise,
- /// returns null.
- const DeclContext *getDeclCtx() const { return CallStack.back(); }
-
/// Returns the function currently being analyzed, or null if the code being
/// analyzed isn't part of a function.
const FunctionDecl *getCurrentFunc() const {
- return dyn_cast<FunctionDecl>(getDeclCtx());
+ return CallStack.empty() ? InitialTargetFunc : CallStack.back();
}
/// Returns the size of the call stack.
----------------
martinboehme wrote:
Can we make this more precise, particularly given that this PR actually changes
what this function returns? See suggestion.
```suggestion
/// Returns the size of the call stack, not counting the initial analysis
target.
```
https://github.com/llvm/llvm-project/pull/91616
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits