|
clang 23.0.0git
|
#include "clang/Analysis/AnalysisDeclContext.h"
Public Types | |
| enum | ContextKind { StackFrameKind } |
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 StackFrame * | 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 |
Static Public Member Functions | |
| static void | ProfileCommon (llvm::FoldingSetNodeID &ID, ContextKind ck, AnalysisDeclContext *ctx, const LocationContext *parent, const void *data) |
Protected Member Functions | |
| LocationContext (ContextKind k, AnalysisDeclContext *ctx, const LocationContext *parent, int64_t ID) | |
Definition at line 206 of file AnalysisDeclContext.h.
| Enumerator | |
|---|---|
| StackFrameKind | |
Definition at line 208 of file AnalysisDeclContext.h.
|
inlineprotected |
Definition at line 221 of file AnalysisDeclContext.h.
References LocationContext().
Referenced by clang::StackFrame::classof(), dumpStack(), getParent(), getStackFrame(), isParentOf(), LocationContext(), clang::StackFrame::LocationContextManager, printJson(), Profile(), clang::StackFrame::Profile(), and ProfileCommon().
|
virtualdefault |
| LLVM_DUMP_METHOD void LocationContext::dump | ( | ) | const |
Definition at line 544 of file AnalysisDeclContext.cpp.
References printJson().
| void LocationContext::dumpStack | ( | raw_ostream & | Out | ) | const |
Prints out the call stack.
| Out | The out stream. |
Definition at line 472 of file AnalysisDeclContext.cpp.
References clang::cast(), getAnalysisDeclContext(), clang::AnalysisDeclContext::getASTContext(), clang::AnalysisDeclContext::getFunctionName(), clang::ASTContext::getSourceManager(), LocationContext(), printLocation(), SM, StackFrameKind, and clang::PrintingPolicy::TerseOutput.
|
inline |
Definition at line 246 of file AnalysisDeclContext.h.
Referenced by clang::ento::ExplodedNode::getAnalysis().
|
inline |
Definition at line 235 of file AnalysisDeclContext.h.
Referenced by clang::ento::SValBuilder::conjureSymbolVal(), dumpStack(), findTopAutosynthesizedParentContext(), clang::ento::SValBuilder::getBlockPointer(), clang::ento::ExplodedNode::getCFGBlock(), clang::ento::ObjCMethodCall::getInitialStackFrameContents(), getLocationForCaller(), clang::ento::AnyFunctionCall::getRuntimeDefinition(), clang::ento::ExplodedNode::getStmtForDiagnostics(), clang::ento::getWidenedLoopState(), clang::ento::isPossiblyEscaped(), clang::ento::retaincountchecker::isSynthesizedAccessor(), printIndicesOfElementsToConstructJson(), printJson(), clang::ProgramPoint::printJson(), printObjectsUnderConstructionJson(), printPendingInitLoopJson(), clang::ento::ExprEngine::processCallExit(), clang::StackFrame::Profile(), clang::ento::ExprEngine::removeDeadOnEndOfFunction(), clang::ento::PathDiagnosticCallPiece::setCallee(), shouldRemoveDeadBindings(), timeTraceMetadata(), and clang::ento::SuppressInlineDefensiveChecksVisitor::VisitNode().
|
inline |
Definition at line 244 of file AnalysisDeclContext.h.
Referenced by clang::ento::CoreEngine::ExecuteWorkList(), clang::FunctionExitPoint::getBlock(), clang::ento::ExplodedNode::getCFG(), clang::CallEnter::getEntry(), clang::ento::PathSensitiveBugReport::getStmt(), and clang::ento::NoStateChangeFuncVisitor::VisitNode().
|
inline |
Definition at line 242 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::ProcessMemberDtor(), clang::ento::PathDiagnosticCallPiece::setCallee(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), wasDifferentDeclUsedForInlining(), clang::ento::NoOwnershipChangeVisitor::wasModifiedInFunction(), and willObjectBeAnalyzedLater().
|
inline |
Definition at line 232 of file AnalysisDeclContext.h.
|
inline |
Definition at line 230 of file AnalysisDeclContext.h.
Referenced by clang::StackFrame::classof().
|
inline |
It might return null.
Definition at line 238 of file AnalysisDeclContext.h.
References LocationContext().
Referenced by clang::ento::ExprEngine::computeObjectUnderConstruction(), clang::ento::CoreEngine::enqueueEndOfFunction(), 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::StackFrame::inTopFrame(), isInMIGCall(), isParentOf(), clang::ento::Environment::printJson(), clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::processEndOfFunction(), clang::StackFrame::Profile(), clang::ento::ExprEngine::removeDead(), clang::ento::ExprEngine::updateObjectsUnderConstruction(), and willObjectBeAnalyzedLater().
|
inline |
Definition at line 248 of file AnalysisDeclContext.h.
Referenced by addContextEdges(), getEnclosingStmtLocation(), clang::ento::ObjCMethodCall::getMessageKind(), clang::ento::ExplodedNode::getParentMap(), and optimizeEdges().
|
inline |
self if this AnalysisDeclContext wraps an ObjCMethodDecl or nullptr otherwise. Definition at line 251 of file AnalysisDeclContext.h.
Referenced by checkSelfIvarsForInvariantViolation(), and clang::ento::ProgramState::getSelfSVal().
| const StackFrame * LocationContext::getStackFrame | ( | ) | const |
Definition at line 438 of file AnalysisDeclContext.cpp.
References getParent(), and LocationContext().
Referenced by 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::getNumVisited(), clang::ento::ExprEngine::getObjectUnderConstruction(), clang::ento::MemRegionManager::getParamVarRegion(), clang::ento::ExprEngine::getPendingArrayDestruction(), clang::ento::ExprEngine::getPendingInitLoop(), clang::AnalysisDeclContext::getStackFrame(), clang::AnalysisDeclContextManager::getStackFrame(), clang::ento::CheckerContext::getStackFrame(), 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::processBranch(), 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().
|
virtual |
Reimplemented in clang::StackFrame.
Definition at line 448 of file AnalysisDeclContext.cpp.
References getStackFrame(), and clang::StackFrame::inTopFrame().
Referenced by clang::ento::ExprEngine::ExecuteWorkList(), clang::ento::MemRegionManager::getCXXThisRegion(), clang::ento::CheckerContext::inTopFrame(), clang::ento::ExprEngine::processBranch(), clang::ento::ExprEngine::processCFGBlockEntrance(), and clang::ento::ExprEngine::processEndOfFunction().
| bool LocationContext::isParentOf | ( | const LocationContext * | LC | ) | const |
Definition at line 452 of file AnalysisDeclContext.cpp.
References getParent(), and LocationContext().
Referenced by GetAllocationSite(), clang::ento::SymbolReaper::isLive(), isVarAnInterestingCondition(), and clang::ento::SuppressInlineDefensiveChecksVisitor::VisitNode().
| void LocationContext::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.
| 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: [&](const LocationContext *LC) { LC->dump(); }
LocationContext(ContextKind k, AnalysisDeclContext *ctx, const LocationContext *parent, int64_t ID) Definition AnalysisDeclContext.h:221 |
Definition at line 500 of file AnalysisDeclContext.cpp.
References clang::cast(), std::function, getAnalysisDeclContext(), clang::AnalysisDeclContext::getASTContext(), clang::ASTContext::getSourceManager(), clang::Indent(), LocationContext(), clang::printSourceLocationAsJson(), SM, StackFrameKind, and clang::PrintingPolicy::TerseOutput.
Referenced by dump(), clang::ento::Environment::printJson(), and printStateTraitWithLocationContextJson().
|
pure virtual |
Implemented in clang::StackFrame.
References std::function, and LocationContext().
|
static |
Definition at line 399 of file AnalysisDeclContext.cpp.
References LocationContext().
Referenced by clang::StackFrame::Profile().