================ @@ -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. size_t callStackSize() const { return CallStack.size(); } /// Returns whether this `Environment` can be extended to analyze the given /// `Callee` (i.e. if `pushCall` can be used), with recursion disallowed and a - /// given `MaxDepth`. - bool canDescend(unsigned MaxDepth, const DeclContext *Callee) const; + /// given `MaxDepth`. Note that the `MaxDepth` does not count any initial + /// target function, which was not called. + bool canDescend(unsigned MaxDepth, const FunctionDecl *Callee) const; ---------------- martinboehme wrote:
Suggestion (can't make this a suggested edit as I'm suggesting to change a line that this PR doesn't touch): ```cxx /// Returns whether this `Environment` can be extended to analyze the given /// `Callee` (i.e. if `pushCall` can be used). /// Recursion is not allowed. `MaxDepth` is the maximum size of the call stack /// (i.e. the maximum value that `callStackSize()` may assume after the call). ``` 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