clang 23.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]

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.
int64_t getID () const
bool isParentOf (const StackFrame *SF) const
const DeclgetDecl () const
CFGgetCFG () const
template<typename T>
T * getAnalysis () 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 205 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 509 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 258 of file AnalysisDeclContext.h.

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 265 of file AnalysisDeclContext.h.

Referenced by getStackOrCaptureRegionForDeclContext().

◆ 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 254 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(), getStackOrCaptureRegionForDeclContext(), 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(), clang::ento::NoOwnershipChangeVisitor::wasModifiedInFunction(), and willObjectBeAnalyzedLater().

◆ getID()

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

Definition at line 250 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 263 of file AnalysisDeclContext.h.

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

◆ inTopFrame()

◆ isParentOf()

◆ 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 470 of file AnalysisDeclContext.cpp.

References std::function, getAnalysisDeclContext(), clang::AnalysisDeclContext::getASTContext(), clang::ASTContext::getSourceManager(), clang::Indent(), 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 304 of file AnalysisDeclContext.h.

References StackFrame().

◆ StackFrameManager

friend class StackFrameManager
friend

Definition at line 206 of file AnalysisDeclContext.h.

References StackFrame(), and StackFrameManager.

Referenced by StackFrameManager.


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