clang 10.0.0git

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
clang::LocationContext Class Referenceabstract

`#include "clang/Analysis/AnalysisDeclContext.h"`

Inheritance diagram for clang::LocationContext:
[legend]
Collaboration diagram for clang::LocationContext:
[legend]

## Public Types
enum | ContextKind { StackFrame, Scope, Block }

## Public Member Functions
virtual | ~LocationContext ()
ContextKind | getKind () const
int64_t | getID () const
AnalysisDeclContext * | getAnalysisDeclContext () const
const LocationContext * | getParent () const
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
| Return true if the current LocationContext has no caller context. More...
virtual void | Profile (llvm::FoldingSetNodeID &ID)=0
void | dumpStack (raw_ostream &Out, const char *NL="\, std::function< void(const LocationContext *)> printMoreInfoPerContext=[](const LocationContext *) {}) const
void | printJson (raw_ostream &Out, const char *NL="\, unsigned int Space=0, bool IsDot=false, std::function< void(const LocationContext *)> printMoreInfoPerContext=[](const LocationContext *) {}) const
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)

## Detailed Description

Definition at line 216 of file AnalysisDeclContext.h.

## Member Enumeration Documentation

## ◆ ContextKind

enum clang::LocationContext::ContextKind

Enumerator
StackFrame |
Scope |
Block |

Definition at line 218 of file AnalysisDeclContext.h.

## Constructor & Destructor Documentation

## ◆ LocationContext()

clang::LocationContext::LocationContext | ( | ContextKind | k,
|  | AnalysisDeclContext * | ctx,
|  | const LocationContext * | parent,
|  | int64_t | ID
| ) |  |
| inline protected

Definition at line 231 of file AnalysisDeclContext.h.

## ◆ ~LocationContext()

LocationContext::~LocationContext | ( |  | ) |
| virtual default

Referenced by clang::AnalysisDeclContext::~AnalysisDeclContext().

## Member Function Documentation

## ◆ dump()

LLVM_DUMP_METHOD void LocationContext::dump | ( |  | ) | const

Definition at line 573 of file AnalysisDeclContext.cpp.

## ◆ dumpStack()

void LocationContext::dumpStack | ( | raw_ostream & | Out,
|  | const char * | NL = `"\n"`,
|  | std::function< void(const LocationContext *)> | printMoreInfoPerContext = `[](const LocationContext *) {}`
| ) |  | const

Definition at line 476 of file AnalysisDeclContext.cpp.

References clang::ASTContext::getLangOpts(), getParent(), SM, and clang::PrintingPolicy::TerseOutput.

Referenced by clang::ento::PrettyStackTraceLocationContext::print().

## ◆ getAnalysis()

template<typename T >

T* clang::LocationContext::getAnalysis | ( |  | ) | const
| inline

Definition at line 256 of file AnalysisDeclContext.h.

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

## ◆ getAnalysisDeclContext()

AnalysisDeclContext* clang::LocationContext::getAnalysisDeclContext | ( |  | ) | const
| inline

Definition at line 245 of file AnalysisDeclContext.h.

Referenced by clang::ento::ExprEngine::bindReturnValue(), findTopAutosynthesizedParentContext(), clang::ento::SValBuilder::getBlockPointer(), clang::ento::CallEvent::getCalleeAnalysisDeclContext(), clang::ento::CallEvent::getCalleeStackFrame(), clang::ento::CheckerContext::getCurrentAnalysisDeclContext(), clang::ObjCMethodCall::getInitialStackFrameContents(), getLocationForCaller(), clang::ento::SValBuilder::getRegionValueSymbolVal(), clang::ento::AnyFunctionCall::getRuntimeDefinition(), clang::ento::ExplodedNode::getStmtForDiagnostics(), clang::ento::getWidenedLoopState(), isReceiverUnconsumedSelf(), clang::ento::retaincountchecker::isSynthesizedAccessor(), printObjectsUnderConstructionJson(), clang::ento::ExprEngine::removeDeadOnEndOfFunction(), clang::ento::PathDiagnosticCallPiece::setCallee(), shouldRemoveDeadBindings(), and clang::ento::ExprEngine::VisitCXXConstructExpr().

## ◆ getCFG()

CFG* clang::LocationContext::getCFG | ( |  | ) | const
| inline

Definition at line 253 of file AnalysisDeclContext.h.

Referenced by clang::ento::CoreEngine::ExecuteWorkList(), clang::ento::CoreEngine::ExecuteWorkListWithInitialState(), clang::ento::ExplodedNode::getCFG(), clang::CallEnter::getEntry(), and clang::ento::PathSensitiveBugReport::getStmt().

## ◆ getDecl()

const Decl* clang::LocationContext::getDecl | ( |  | ) | const
| inline

Definition at line 251 of file AnalysisDeclContext.h.

Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkBeginFunction(), checkInvariantViolation(), checkSelfIvarsForInvariantViolation(), clang::ento::PathDiagnosticCallPiece::construct(), clang::ento::ExprEngine::CreateCXXTemporaryObject(), clang::ento::PathDiagnosticLocation::createDeclBegin(), clang::ento::PathDiagnosticLocation::createDeclEnd(), clang::ento::CoreEngine::ExecuteWorkList(), clang::ento::CoreEngine::ExecuteWorkListWithInitialState(), clang::CallEventManager::getCaller(), clang::ento::ExplodedNode::getCodeDecl(), clang::ento::MemRegionManager::getCXXThisRegion(), clang::ento::PathSensitiveBugReport::getDeclWithIssue(), getEnclosingStmtLocation(), clang::ento::AnyFunctionCall::getInitialStackFrameContents(), clang::BlockCall::getInitialStackFrameContents(), clang::CXXInstanceCall::getInitialStackFrameContents(), clang::CXXConstructorCall::getInitialStackFrameContents(), clang::ObjCMethodCall::getInitialStackFrameContents(), clang::ento::ExprEngine::getInitialState(), isInMIGCall(), clang::ento::retaincountchecker::isSynthesizedAccessor(), clang::ento::ExprEngine::ProcessBaseDtor(), clang::ento::ExprEngine::processCFGBlockEntrance(), clang::ento::ExprEngine::ProcessMemberDtor(), recordFixedType(), clang::ento::PathDiagnosticCallPiece::setCallee(), updateExecutedLinesWithDiagnosticPieces(), clang::ento::ExprEngine::VisitCXXConstructExpr(), wasDifferentDeclUsedForInlining(), and willObjectBeAnalyzedLater().

## ◆ getID()

int64_t clang::LocationContext::getID | ( |  | ) | const
| inline

Definition at line 241 of file AnalysisDeclContext.h.

## ◆ getKind()

ContextKind clang::LocationContext::getKind | ( |  | ) | const
| inline

Definition at line 239 of file AnalysisDeclContext.h.

Referenced by clang::StackFrameContext::classof(), clang::ScopeContext::classof(), and clang::BlockInvocationContext::classof().

## ◆ getParent()

const LocationContext* clang::LocationContext::getParent | ( |  | ) | const
| inline

Definition at line 247 of file AnalysisDeclContext.h.

References Parent.

Referenced by clang::ento::ExprEngine::CreateCXXTemporaryObject(), dumpStack(), findTopAutosynthesizedParentContext(), getArgumentValueString(), clang::CallEventManager::getCaller(), clang::ento::MemRegionManager::getCXXThisRegion(), clang::ento::ExprEngine::getInitialState(), clang::ento::ExprEngine::getObjectUnderConstruction(), getStackFrame(), getStackOrCaptureRegionForDeclContext(), isInMIGCall(), isParentOf(), isPointerToConst(), isReferenceCountingPointerDestructor(), clang::ento::Environment::printJson(), printJson(), clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::processEndOfFunction(), clang::ento::ExprEngine::removeDead(), and willObjectBeAnalyzedLater().

## ◆ getParentMap()

const ParentMap& clang::LocationContext::getParentMap | ( |  | ) | const
| inline

Definition at line 260 of file AnalysisDeclContext.h.

Referenced by addContextEdges(), getEnclosingStmtLocation(), clang::ObjCMethodCall::getMessageKind(), clang::ento::ExplodedNode::getParentMap(), clang::ento::ExplodedGraph::isInterestingLValueExpr(), optimizeEdges(), recordFixedType(), and clang::ento::ExprEngine::VisitCXXConstructExpr().

## ◆ getSelfDecl()

const ImplicitParamDecl* clang::LocationContext::getSelfDecl | ( |  | ) | const
| inline

Definition at line 264 of file AnalysisDeclContext.h.

References dump(), and clang::AnalysisDeclContext::getSelfDecl().

Referenced by checkSelfIvarsForInvariantViolation(), clang::ObjCMethodCall::getSelfSVal(), and recordFixedType().

## ◆ getStackFrame()

const StackFrameContext * LocationContext::getStackFrame | ( |  | ) | const

Definition at line 442 of file AnalysisDeclContext.cpp.

References getParent().

Referenced by clang::ento::ExprEngine::bindReturnValue(), clang::ento::NodeBuilderContext::blockCount(), clang::ento::ExprEngine::CreateCXXTemporaryObject(), clang::ento::CoreEngine::ExecuteWorkListWithInitialState(), clang::ento::MemRegionManager::getAllocaRegion(), getArgumentValueString(), clang::ento::MemRegionManager::getBlockDataRegion(), clang::CallEventManager::getCaller(), clang::ento::MemRegionManager::getCompoundLiteralRegion(), clang::ento::MemRegionManager::getCXXTempObjectRegion(), clang::ento::MemRegionManager::getCXXThisRegion(), clang::ento::PathSensitiveBugReport::getDeclWithIssue(), clang::ento::ExprEngine::getInitialState(), clang::ento::ExprEngine::getObjectUnderConstruction(), clang::ProgramPoint::getStackFrame(), clang::ento::getWidenedLoopState(), isInitializationOfVar(), isInMIGCall(), isPointerToConst(), isRecordEmpty(), clang::ento::WorkList::makeBFSBlockDFSContents(), clang::ento::WorkList::makeUnexploredFirst(), parameterTypeFromSVal(), printExpectedDeallocName(), clang::ento::Environment::printJson(), clang::ento::ExprEngine::ProcessBaseDtor(), clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::processCFGBlockEntrance(), clang::ento::ExprEngine::processEndOfFunction(), clang::ento::ExprEngine::ProcessMemberDtor(), recordFixedType(), REGISTER_MAP_WITH_PROGRAMSTATE(), clang::ento::ExprEngine::removeDead(), clang::ento::ExprEngine::VisitCallExpr(), clang::ento::ExprEngine::VisitCXXConstructExpr(), and wasRegionOfInterestModifiedAt().

## ◆ inTopFrame()

bool LocationContext::inTopFrame | ( |  | ) | const
| virtual

Return true if the current LocationContext has no caller context.

Reimplemented in clang::StackFrameContext.

Definition at line 452 of file AnalysisDeclContext.cpp.

References clang::AnalysisDeclContextManager::getStackFrame(), and clang::StackFrameContext::inTopFrame().

Referenced by clang::ento::MemRegionManager::getCXXThisRegion(), clang::ento::CheckerContext::inTopFrame(), and clang::ento::ExprEngine::processEndOfFunction().

## ◆ isParentOf()

bool LocationContext::isParentOf | ( | const LocationContext * | LC | ) | const

Definition at line 456 of file AnalysisDeclContext.cpp.

References getParent(), and Parent.

Referenced by getAsPointeeSymbol(), isReferenceCountingPointerDestructor(), and printExpectedDeallocName().

## ◆ printJson()

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

Definition at line 518 of file AnalysisDeclContext.cpp.

References clang::ASTContext::getLangOpts(), getParent(), clang::Indent(), SM, and clang::PrintingPolicy::TerseOutput.

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

## ◆ Profile()

virtual void clang::LocationContext::Profile | ( | llvm::FoldingSetNodeID & | ID | ) |
| pure virtual

Implemented in clang::BlockInvocationContext, clang::ScopeContext, and clang::StackFrameContext.

## ◆ ProfileCommon()

void LocationContext::ProfileCommon | ( | llvm::FoldingSetNodeID & | ID,
|  | ContextKind | ck,
|  | AnalysisDeclContext * | ctx,
|  | const LocationContext * | parent,
|  | const void * | data
| ) |  |
| static

Definition at line 352 of file AnalysisDeclContext.cpp.

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

- include/clang/Analysis/AnalysisDeclContext.h
- lib/Analysis/AnalysisDeclContext.cpp