clang: clang::LocationContext Class Reference (original) (raw)
It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext and inside the function calls the BlockInvocationContext. More...
#include "[clang/Analysis/AnalysisDeclContext.h](AnalysisDeclContext%5F8h%5Fsource.html)"
Public Member Functions | |
---|---|
virtual | ~LocationContext () |
ContextKind | getKind () const |
int64_t | getID () const |
LLVM_ATTRIBUTE_RETURNS_NONNULL AnalysisDeclContext * | getAnalysisDeclContext () const |
const LocationContext * | getParent () const |
It might return null. | |
bool | isParentOf (const LocationContext *LC) const |
const Decl * | getDecl () const |
CFG * | getCFG () const |
template<typename T > | |
T * | getAnalysis () const |
const ParentMap & | getParentMap () const |
const ImplicitParamDecl * | getSelfDecl () const |
const StackFrameContext * | getStackFrame () const |
virtual bool | inTopFrame () const |
virtual void | Profile (llvm::FoldingSetNodeID &ID)=0 |
LLVM_DUMP_METHOD void | dumpStack (raw_ostream &Out) const |
Prints out the call stack. | |
void | printJson (raw_ostream &Out, const char *NL="\n", unsigned int Space=0, bool IsDot=false, std::function< void(const LocationContext *)> printMoreInfoPerContext=[](const LocationContext *) {}) const |
Prints out the call stack in json format. | |
LLVM_DUMP_METHOD void | dump () const |
It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext and inside the function calls the BlockInvocationContext.
It is needed for context sensitive analysis to model entering, leaving or inlining function calls.
Examples
Definition at line 215 of file AnalysisDeclContext.h.
◆ ContextKind
◆ ~LocationContext()
LocationContext::~LocationContext ( ) | virtualdefault |
---|
◆ dump()
LLVM_DUMP_METHOD void LocationContext::dump | ( | ) | const |
---|
◆ dumpStack()
void LocationContext::dumpStack | ( | raw_ostream & | Out | ) | const |
---|
Prints out the call stack.
Parameters
Definition at line 496 of file AnalysisDeclContext.cpp.
References Block, D, getAnalysisDeclContext(), clang::AnalysisDeclContext::getASTContext(), clang::Decl::getBeginLoc(), getDecl(), clang::AnalysisDeclContext::getFunctionName(), clang::ASTContext::getLangOpts(), getParent(), clang::ASTContext::getSourceManager(), printLocation(), SM, StackFrame, and clang::PrintingPolicy::TerseOutput.
Referenced by clang::ento::PrettyStackTraceLocationContext::print().
◆ getAnalysis()
template<typename T >
T * clang::LocationContext::getAnalysis ( ) const | inline |
---|
◆ getAnalysisDeclContext()
LLVM_ATTRIBUTE_RETURNS_NONNULL AnalysisDeclContext * clang::LocationContext::getAnalysisDeclContext ( ) const | inline |
---|
Definition at line 244 of file AnalysisDeclContext.h.
Referenced by clang::ento::SValBuilder::conjureSymbolVal(), dumpStack(), findTopAutosynthesizedParentContext(), clang::ento::SValBuilder::getBlockPointer(), clang::ento::CallEvent::getCalleeAnalysisDeclContext(), clang::ento::CallEvent::getCalleeStackFrame(), clang::ento::ExplodedNode::getCFGBlock(), clang::ento::CheckerContext::getCurrentAnalysisDeclContext(), clang::ento::ObjCMethodCall::getInitialStackFrameContents(), getLocationForCaller(), clang::ento::AnyFunctionCall::getRuntimeDefinition(), clang::ento::ExplodedNode::getStmtForDiagnostics(), clang::ento::getWidenedLoopState(), clang::ento::isPossiblyEscaped(), clang::ento::retaincountchecker::isSynthesizedAccessor(), printIndicesOfElementsToConstructJson(), clang::ProgramPoint::printJson(), printJson(), printObjectsUnderConstructionJson(), printPendingInitLoopJson(), clang::ento::ExprEngine::processCallExit(), clang::StackFrameContext::Profile(), clang::BlockInvocationContext::Profile(), clang::ento::ExprEngine::removeDeadOnEndOfFunction(), clang::ento::PathDiagnosticCallPiece::setCallee(), shouldRemoveDeadBindings(), and clang::ento::SuppressInlineDefensiveChecksVisitor::VisitNode().
◆ getCFG()
CFG * clang::LocationContext::getCFG ( ) const | inline |
---|
◆ getDecl()
const Decl * clang::LocationContext::getDecl ( ) const | inline |
---|
Examples
Definition at line 251 of file AnalysisDeclContext.h.
References clang::AnalysisDeclContext::getDecl().
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkBeginFunction(), checkInvariantViolation(), checkSelfIvarsForInvariantViolation(), clang::ento::ExprEngine::computeObjectUnderConstruction(), clang::ento::PathDiagnosticCallPiece::construct(), clang::ento::PathDiagnosticLocation::createDeclBegin(), clang::ento::PathDiagnosticLocation::createDeclEnd(), dumpStack(), clang::ento::SymbolConjured::dumpToStream(), 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::AnyFunctionCall::getInitialStackFrameContents(), clang::ento::BlockCall::getInitialStackFrameContents(), clang::ento::CXXInstanceCall::getInitialStackFrameContents(), clang::ento::AnyCXXConstructorCall::getInitialStackFrameContents(), clang::ento::ObjCMethodCall::getInitialStackFrameContents(), clang::ento::ExprEngine::getInitialState(), clang::ento::MemRegionManager::getVarRegion(), clang::ento::getWidenedLoopState(), clang::ento::isCapturedByReference(), isInMIGCall(), clang::ento::retaincountchecker::isSynthesizedAccessor(), printJson(), clang::ento::ExprEngine::ProcessBaseDtor(), clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::processCFGBlockEntrance(), clang::ento::ExprEngine::ProcessMemberDtor(), clang::ento::PathDiagnosticCallPiece::setCallee(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), clang::ento::SValExplainer::VisitParamVarRegion(), wasDifferentDeclUsedForInlining(), clang::ento::NoOwnershipChangeVisitor::wasModifiedInFunction(), and willObjectBeAnalyzedLater().
◆ getID()
int64_t clang::LocationContext::getID ( ) const | inline |
---|
◆ getKind()
ContextKind clang::LocationContext::getKind ( ) const | inline |
---|
◆ getParent()
It might return null.
Definition at line 247 of file AnalysisDeclContext.h.
References Parent.
Referenced by clang::ento::ExprEngine::computeObjectUnderConstruction(), dumpStack(), clang::ento::LikelyFalsePositiveSuppressionBRVisitor::finalizeVisitor(), findTopAutosynthesizedParentContext(), getCalleeNode(), clang::ento::CallEventManager::getCaller(), clang::ento::MemRegionManager::getCXXThisRegion(), clang::ento::CXXInheritedConstructorCall::getInheritingStackFrame(), clang::ento::ExprEngine::getInitialState(), getStackFrame(), getStackOrCaptureRegionForDeclContext(), clang::StackFrameContext::inTopFrame(), isInMIGCall(), isParentOf(), clang::ento::Environment::printJson(), printJson(), clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::processEndOfFunction(), clang::StackFrameContext::Profile(), clang::BlockInvocationContext::Profile(), clang::ento::ExprEngine::removeDead(), clang::ento::ExprEngine::updateObjectsUnderConstruction(), and willObjectBeAnalyzedLater().
◆ getParentMap()
const ParentMap & clang::LocationContext::getParentMap ( ) const | inline |
---|
◆ getSelfDecl()
◆ getStackFrame()
Examples
Definition at line 462 of file AnalysisDeclContext.cpp.
References getParent().
Referenced by clang::ento::NodeBuilderContext::blockCount(), clang::ento::ExprEngine::computeObjectUnderConstruction(), clang::ento::MemRegionManager::getAllocaRegion(), GetAllocationSite(), clang::ento::MemRegionManager::getBlockDataRegion(), getCalleeNode(), clang::ento::CallEventManager::getCaller(), clang::ento::MemRegionManager::getCompoundLiteralRegion(), clang::ento::MemRegionManager::getCXXLifetimeExtendedObjectRegion(), clang::ento::MemRegionManager::getCXXTempObjectRegion(), clang::ento::MemRegionManager::getCXXThisRegion(), clang::ento::PathSensitiveBugReport::getDeclWithIssue(), clang::ento::ExprEngine::getIndexOfElementToConstruct(), clang::ento::CXXInheritedConstructorCall::getInheritingStackFrame(), clang::ento::ExprEngine::getInitialState(), clang::ento::ExprEngine::getObjectUnderConstruction(), clang::ento::MemRegionManager::getParamVarRegion(), clang::ento::ExprEngine::getPendingArrayDestruction(), clang::ento::ExprEngine::getPendingInitLoop(), clang::ProgramPoint::getStackFrame(), clang::ento::MemRegionManager::getVarRegion(), clang::ento::getWidenedLoopState(), inTopFrame(), isInitializationOfVar(), isInMIGCall(), clang::ento::SymbolReaper::isLive(), clang::ento::Environment::printJson(), clang::ento::ExprEngine::ProcessBaseDtor(), clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::processCFGBlockEntrance(), clang::ento::ExprEngine::processEndOfFunction(), clang::ento::ExprEngine::ProcessMemberDtor(), clang::ento::ExprEngine::removeDead(), clang::ento::ExprEngine::updateObjectsUnderConstruction(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), clang::ento::NoStateChangeFuncVisitor::VisitNode(), and clang::ento::retaincountchecker::RefCountReportVisitor::VisitNode().
◆ inTopFrame()
bool LocationContext::inTopFrame ( ) const | virtual |
---|
◆ isParentOf()
◆ printJson()
Prints out the call stack in json
format.
Parameters
Out | The out stream. |
---|---|
NL | The newline. |
Space | The space count for indentation. |
IsDot | Whether the output format is dot. |
printMoreInfoPerContext | A callback to print more information for each context, for example: It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext ... |
Definition at line 531 of file AnalysisDeclContext.cpp.
References Block, D, getAnalysisDeclContext(), clang::AnalysisDeclContext::getASTContext(), clang::Decl::getBeginLoc(), getDecl(), clang::ASTContext::getLangOpts(), getParent(), clang::ASTContext::getSourceManager(), clang::printSourceLocationAsJson(), SM, StackFrame, and clang::PrintingPolicy::TerseOutput.
Referenced by dump(), clang::ento::Environment::printJson(), and printStateTraitWithLocationContextJson().
◆ Profile()
virtual void clang::LocationContext::Profile ( llvm::FoldingSetNodeID & ID) | pure virtual |
---|
◆ ProfileCommon()
The documentation for this class was generated from the following files:
- include/clang/Analysis/AnalysisDeclContext.h
- lib/Analysis/AnalysisDeclContext.cpp