clang 24.0.0git
clang::StackFrame Class Referencefinal

It represents a stack frame of the call stack. More...

#include "clang/Analysis/AnalysisDeclContext.h"

Inheritance diagram for clang::StackFrame:
[legend]

Classes

class  parent_iterator
 Forward iterator over a chain of StackFrame parents. More...

Public Member Functions

 StackFrame (AnalysisDeclContext *ADC, const StackFrame *Parent, const void *Data, const Expr *E, const CFGBlock *Block, unsigned BlockCount, unsigned Index, int64_t ID)
 ~StackFrame ()=default
LLVM_ATTRIBUTE_RETURNS_NONNULL AnalysisDeclContextgetAnalysisDeclContext () const
const StackFramegetParent () const
 It might return null.
llvm::iterator_range< parent_iteratorparents () const
 Iterates over the strict ancestors of this frame, i.e.
llvm::iterator_range< parent_iteratorparentsIncludingSelf () const
 Iterates over this frame followed by all of its ancestors.
int64_t getID () const
bool isParentOf (const StackFrame *SF) const
const DeclgetDecl () const
CFGgetCFG () const
template<typename T>
TgetAnalysis () const
const ParentMapgetParentMap () const
const ImplicitParamDeclgetSelfDecl () const
const void * getData () const
const ExprgetCallSite () const
const CFGBlockgetCallSiteBlock () const
bool inTopFrame () const
unsigned getIndex () const
CFGElement getCallSiteCFGElement () const
void printJson (raw_ostream &Out, const char *NL="\n", unsigned int Space=0, bool IsDot=false, std::function< void(const StackFrame *)> printMoreInfoPerStackFrame=[](const StackFrame *) {}) const
 Prints out the call stack in json format.
LLVM_DUMP_METHOD void dumpStack (raw_ostream &Out) const
 Prints out the call stack.
LLVM_DUMP_METHOD void dump () const
void Profile (llvm::FoldingSetNodeID &ID)

Static Public Member Functions

static void Profile (llvm::FoldingSetNodeID &ID, AnalysisDeclContext *ADC, const StackFrame *SF, const void *Data, const Expr *E, const CFGBlock *Block, unsigned BlockCount, unsigned Index)

Friends

class StackFrameManager

Detailed Description

It represents a stack frame of the call stack.

Definition at line 206 of file AnalysisDeclContext.h.

Constructor & Destructor Documentation

◆ StackFrame()

clang::StackFrame::StackFrame ( AnalysisDeclContext * ADC,
const StackFrame * Parent,
const void * Data,
const Expr * E,
const CFGBlock * Block,
unsigned BlockCount,
unsigned Index,
int64_t ID )
inline

◆ ~StackFrame()

clang::StackFrame::~StackFrame ( )
default

Member Function Documentation

◆ dump()

LLVM_DUMP_METHOD void StackFrame::dump ( ) const

Definition at line 499 of file AnalysisDeclContext.cpp.

References printJson().

◆ dumpStack()

void StackFrame::dumpStack ( raw_ostream & Out) const

◆ getAnalysis()

template<typename T>
T * clang::StackFrame::getAnalysis ( ) const
inline

Definition at line 306 of file AnalysisDeclContext.h.

References clang::T.

Referenced by clang::ento::ExplodedNode::getAnalysis().

◆ getAnalysisDeclContext()

◆ getCallSite()

◆ getCallSiteBlock()

◆ getCallSiteCFGElement()

CFGElement clang::StackFrame::getCallSiteCFGElement ( ) const
inline

◆ getCFG()

◆ getData()

const void * clang::StackFrame::getData ( ) const
inline

Definition at line 313 of file AnalysisDeclContext.h.

◆ getDecl()

const Decl * clang::StackFrame::getDecl ( ) const
inline
Examples
/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 302 of file AnalysisDeclContext.h.

Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkBeginFunction(), checkInvariantViolation(), checkSelfIvarsForInvariantViolation(), clang::ento::ExprEngine::computeObjectUnderConstruction(), clang::ento::PathDiagnosticCallPiece::construct(), clang::ento::PathDiagnosticLocation::create(), clang::ento::PathDiagnosticLocation::createDeclBegin(), clang::ento::PathDiagnosticLocation::createDeclEnd(), clang::ento::CoreEngine::ExecuteWorkList(), clang::ento::ExprEngine::ExecuteWorkList(), exitingDestructor(), clang::ento::LikelyFalsePositiveSuppressionBRVisitor::finalizeVisitor(), findExecutedLines(), clang::ento::CallEventManager::getCaller(), clang::ento::ExplodedNode::getCodeDecl(), clang::ento::MemRegionManager::getCXXThisRegion(), clang::ento::ParamVarRegion::getDecl(), clang::ento::PathSensitiveBugReport::getDeclWithIssue(), getEnclosingStmtLocation(), clang::ento::AnyCXXConstructorCall::getInitialStackFrameContents(), clang::ento::AnyFunctionCall::getInitialStackFrameContents(), clang::ento::BlockCall::getInitialStackFrameContents(), clang::ento::CXXInstanceCall::getInitialStackFrameContents(), clang::ento::ObjCMethodCall::getInitialStackFrameContents(), clang::ento::ExprEngine::getInitialState(), clang::ento::MemRegionManager::getVarRegion(), clang::ento::getWidenedLoopState(), clang::ento::isCapturedByReference(), isInMIGCall(), clang::ento::retaincountchecker::isSynthesizedAccessor(), clang::ento::ExprEngine::ProcessBaseDtor(), clang::ento::ExprEngine::processBranch(), clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::processCFGBlockEntrance(), clang::ento::ExprEngine::ProcessInitializer(), clang::ento::ExprEngine::ProcessMemberDtor(), clang::ento::PathDiagnosticCallPiece::setCallee(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), wasDifferentDeclUsedForInlining(), and clang::ento::NoOwnershipChangeVisitor::wasModifiedInFunction().

◆ getID()

int64_t clang::StackFrame::getID ( ) const
inline

Definition at line 298 of file AnalysisDeclContext.h.

◆ getIndex()

◆ getParent()

◆ getParentMap()

◆ getSelfDecl()

const ImplicitParamDecl * clang::StackFrame::getSelfDecl ( ) const
inline

Returns
The ImplicitParamDecl associated with self if this AnalysisDeclContext wraps an ObjCMethodDecl or nullptr otherwise.

Definition at line 311 of file AnalysisDeclContext.h.

Referenced by checkSelfIvarsForInvariantViolation(), and clang::ento::ProgramState::getSelfSVal().

◆ inTopFrame()

◆ isParentOf()

◆ parents()

llvm::iterator_range< parent_iterator > clang::StackFrame::parents ( ) const
inline

Iterates over the strict ancestors of this frame, i.e.

getParent(), getParent()->getParent(), ... up to (but excluding) the null frame. Does not include *this.

Definition at line 289 of file AnalysisDeclContext.h.

References getParent().

Referenced by isParentOf().

◆ parentsIncludingSelf()

llvm::iterator_range< parent_iterator > clang::StackFrame::parentsIncludingSelf ( ) const
inline

◆ printJson()

void StackFrame::printJson ( raw_ostream & Out,
const char * NL = "\n",
unsigned int Space = 0,
bool IsDot = false,
std::function< void(const StackFrame *)> printMoreInfoPerStackFrame = [](const StackFrame *) {} ) const

Prints out the call stack in json format.

Parameters
OutThe out stream.
NLThe newline.
SpaceThe space count for indentation.
IsDotWhether the output format is dot.
printMoreInfoPerStackFrameA callback to print more information for each stack frame, for example:
[&](const StackFrame *SF) { SF->dump(); }
StackFrame(AnalysisDeclContext *ADC, const StackFrame *Parent, const void *Data, const Expr *E, const CFGBlock *Block, unsigned BlockCount, unsigned Index, int64_t ID)

Definition at line 462 of file AnalysisDeclContext.cpp.

References std::function, getAnalysisDeclContext(), clang::AnalysisDeclContext::getASTContext(), clang::ASTContext::getSourceManager(), clang::Indent(), parentsIncludingSelf(), clang::printSourceLocationAsJson(), SM, StackFrame(), and clang::PrintingPolicy::TerseOutput.

Referenced by dump(), clang::ento::Environment::printJson(), and printStateTraitWithStackFrameJson().

◆ Profile() [1/2]

void StackFrame::Profile ( llvm::FoldingSetNodeID & ID)

◆ Profile() [2/2]

void clang::StackFrame::Profile ( llvm::FoldingSetNodeID & ID,
AnalysisDeclContext * ADC,
const StackFrame * SF,
const void * Data,
const Expr * E,
const CFGBlock * Block,
unsigned BlockCount,
unsigned Index )
inlinestatic

Definition at line 352 of file AnalysisDeclContext.h.

References StackFrame().

◆ StackFrameManager

friend class StackFrameManager
friend

Definition at line 207 of file AnalysisDeclContext.h.

References StackFrame(), and StackFrameManager.

Referenced by StackFrameManager.


The documentation for this class was generated from the following files: