clang 20.0.0git
|
AnalysisDeclContext contains the context data for the function, method or block under analysis. More...
#include "clang/Analysis/AnalysisDeclContext.h"
Public Types | |
using | referenced_decls_iterator = const VarDecl *const * |
Static Public Member Functions | |
static bool | isInStdNamespace (const Decl *D) |
static std::string | getFunctionName (const Decl *D) |
AnalysisDeclContext contains the context data for the function, method or block under analysis.
Definition at line 72 of file AnalysisDeclContext.h.
using clang::AnalysisDeclContext::referenced_decls_iterator = const VarDecl *const * |
Definition at line 171 of file AnalysisDeclContext.h.
AnalysisDeclContext::AnalysisDeclContext | ( | AnalysisDeclContextManager * | Mgr, |
const Decl * | D | ||
) |
Definition at line 62 of file AnalysisDeclContext.cpp.
References clang::CFG::BuildOptions::forcedBlkExprs.
AnalysisDeclContext::AnalysisDeclContext | ( | AnalysisDeclContextManager * | Mgr, |
const Decl * | D, | ||
const CFG::BuildOptions & | BuildOptions | ||
) |
Definition at line 55 of file AnalysisDeclContext.cpp.
References clang::CFG::BuildOptions::forcedBlkExprs.
AnalysisDeclContext::~AnalysisDeclContext | ( | ) |
Definition at line 685 of file AnalysisDeclContext.cpp.
void AnalysisDeclContext::dumpCFG | ( | bool | ShowColors | ) |
Definition at line 274 of file AnalysisDeclContext.cpp.
References clang::CFG::dump(), getASTContext(), getCFG(), and ShowColors.
|
inline |
Definition at line 119 of file AnalysisDeclContext.h.
References clang::CFG::BuildOptions::AddEHEdges.
|
inline |
Definition at line 123 of file AnalysisDeclContext.h.
References clang::CFG::BuildOptions::AddImplicitDtors.
|
inline |
Definition at line 124 of file AnalysisDeclContext.h.
References clang::CFG::BuildOptions::AddInitializers.
Definition at line 192 of file AnalysisDeclContext.h.
References clang::T.
Referenced by clang::LocationContext::getAnalysis(), and clang::ento::AnalysisManager::getAnalysis().
|
inline |
Definition at line 104 of file AnalysisDeclContext.h.
References D.
Referenced by clang::ento::SValBuilder::conjureSymbolVal(), dumpCFG(), clang::LocationContext::dumpStack(), clang::ento::getWidenedLoopState(), clang::ento::isPossiblyEscaped(), printIndicesOfElementsToConstructJson(), clang::ProgramPoint::printJson(), clang::LocationContext::printJson(), printObjectsUnderConstructionJson(), printPendingInitLoopJson(), and clang::threadSafety::CFGWalker::walk().
Definition at line 190 of file AnalysisDeclContext.cpp.
References clang::ast_matchers::stmt.
const BlockInvocationContext * AnalysisDeclContext::getBlockInvocationContext | ( | const LocationContext * | ParentLC, |
const BlockDecl * | BD, | ||
const void * | Data | ||
) |
Obtain a context of the block invocation using its parent context.
ADC | The AnalysisDeclContext. |
ParentLC | The parent context of this newly created context. |
BD | The BlockDecl. |
Data | The raw data to store as part of the context. |
Definition at line 318 of file AnalysisDeclContext.cpp.
References clang::Data, and clang::LocationContextManager::getBlockInvocationContext().
Stmt * AnalysisDeclContext::getBody | ( | ) | const |
D
. Definition at line 126 of file AnalysisDeclContext.cpp.
References getBody().
Referenced by getBody(), getCFG(), getLocationForCaller(), getParentMap(), clang::ento::AnyFunctionCall::getRuntimeDefinition(), getUnoptimizedCFG(), clang::ento::PathDiagnosticLocation::getValidSourceLocation(), isBodyAutosynthesized(), isBodyAutosynthesizedFromModelFile(), clang::ento::ExprEngine::processCallExit(), and clang::ento::ExprEngine::removeDeadOnEndOfFunction().
D
. [out] | IsAutosynthesized | Specifies if the body is auto-generated by the BodyFarm. |
Definition at line 93 of file AnalysisDeclContext.cpp.
References clang::BodyFarm::getBody(), clang::AnalysisDeclContextManager::getBodyFarm(), and clang::AnalysisDeclContextManager::synthesizeBodies().
CFG * AnalysisDeclContext::getCFG | ( | ) |
Definition at line 213 of file AnalysisDeclContext.cpp.
References addParentsForSyntheticStmts(), clang::CFG::buildCFG(), clang::Decl::getASTContext(), getBody(), getCFGBuildOptions(), getUnoptimizedCFG(), clang::CFG::BuildOptions::Observer, and clang::CFG::BuildOptions::PruneTriviallyFalseEdges.
Referenced by clang::PostOrderCFGView::create(), dumpCFG(), clang::LocationContext::getCFG(), clang::ento::AnalysisManager::getCFG(), getCFGReachablityAnalysis(), getCFGStmtMap(), and getParentMap().
|
inline |
Definition at line 110 of file AnalysisDeclContext.h.
Referenced by getCFG(), and getUnoptimizedCFG().
|
inline |
Definition at line 112 of file AnalysisDeclContext.h.
CFGReverseBlockReachabilityAnalysis * AnalysisDeclContext::getCFGReachablityAnalysis | ( | ) |
Definition at line 262 of file AnalysisDeclContext.cpp.
CFGStmtMap * AnalysisDeclContext::getCFGStmtMap | ( | ) |
Definition at line 250 of file AnalysisDeclContext.cpp.
References clang::CFGStmtMap::Build(), c, getCFG(), and getParentMap().
Referenced by clang::ento::CallEvent::getCalleeStackFrame(), clang::ento::ExplodedNode::getCFGBlock(), and clang::ento::SuppressInlineDefensiveChecksVisitor::VisitNode().
|
inline |
Definition at line 106 of file AnalysisDeclContext.h.
References D.
Referenced by emitDiagnostics(), clang::threadSafety::CFGWalker::getDecl(), clang::LocationContext::getDecl(), getLocationForCaller(), getParentMap(), clang::ento::AnyFunctionCall::getRuntimeDefinition(), and clang::ento::PathDiagnosticLocation::getValidSourceLocation().
|
static |
Definition at line 339 of file AnalysisDeclContext.cpp.
References D, clang::Decl::getASTContext(), clang::ASTContext::getLangOpts(), clang::Decl::getLocation(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isValid(), Loc, and P.
Referenced by clang::LocationContext::dumpStack().
|
inline |
Definition at line 108 of file AnalysisDeclContext.h.
Referenced by clang::ento::CallEvent::getCalleeAnalysisDeclContext(), and clang::ento::CallEvent::getCalleeStackFrame().
ParentMap & AnalysisDeclContext::getParentMap | ( | ) |
Definition at line 278 of file AnalysisDeclContext.cpp.
References addParentsForSyntheticStmts(), clang::C, getBody(), getCFG(), getDecl(), and getUnoptimizedCFG().
Referenced by getCFGStmtMap(), clang::LocationContext::getParentMap(), clang::ento::AnalysisManager::getParentMap(), clang::ento::PathDiagnosticLocation::getValidSourceLocation(), and shouldRemoveDeadBindings().
llvm::iterator_range< AnalysisDeclContext::referenced_decls_iterator > AnalysisDeclContext::getReferencedBlockVars | ( | const BlockDecl * | BD | ) |
Definition at line 663 of file AnalysisDeclContext.cpp.
References LazyInitializeReferencedDecls(), and V.
const ImplicitParamDecl * AnalysisDeclContext::getSelfDecl | ( | ) | const |
self
if this AnalysisDeclContext wraps an ObjCMethodDecl or nullptr otherwise. Definition at line 148 of file AnalysisDeclContext.cpp.
References clang::CXXRecordDecl::captures(), clang::DeclContext::getParent(), clang::CXXRecordDecl::isLambda(), and isSelfDecl().
Referenced by clang::ento::ObjCMethodCall::getInitialStackFrameContents(), clang::LocationContext::getSelfDecl(), and isSelfVar().
const StackFrameContext * AnalysisDeclContext::getStackFrame | ( | LocationContext const * | ParentLC, |
const Stmt * | S, | ||
const CFGBlock * | Blk, | ||
unsigned | BlockCount, | ||
unsigned | Index | ||
) |
Obtain a context of the call stack using its parent context.
ADC | The AnalysisDeclContext. |
ParentLC | The parent context of this newly created context. |
S | The call. |
Block | The basic block. |
BlockCount | The current count of entering into Blk . |
Index | The index of Blk . |
D
with parent context ParentLC
. Definition at line 311 of file AnalysisDeclContext.cpp.
References clang::LocationContextManager::getStackFrame().
CFG * AnalysisDeclContext::getUnoptimizedCFG | ( | ) |
Definition at line 232 of file AnalysisDeclContext.cpp.
References addParentsForSyntheticStmts(), clang::CFG::buildCFG(), clang::Decl::getASTContext(), getBody(), getCFGBuildOptions(), clang::CFG::BuildOptions::Observer, and clang::CFG::BuildOptions::PruneTriviallyFalseEdges.
Referenced by getCFG(), and getParentMap().
|
inline |
Definition at line 120 of file AnalysisDeclContext.h.
References clang::CFG::BuildOptions::PruneTriviallyFalseEdges.
bool AnalysisDeclContext::isBodyAutosynthesized | ( | ) | const |
Definition at line 131 of file AnalysisDeclContext.cpp.
References getBody().
Referenced by clang::ento::PathSensitiveBugReporter::emitReport(), findTopAutosynthesizedParentContext(), clang::ento::ExplodedNode::getStmtForDiagnostics(), clang::ento::retaincountchecker::isSynthesizedAccessor(), and clang::ento::PathDiagnosticCallPiece::setCallee().
bool AnalysisDeclContext::isBodyAutosynthesizedFromModelFile | ( | ) | const |
Definition at line 137 of file AnalysisDeclContext.cpp.
References clang::Stmt::getBeginLoc(), getBody(), and clang::SourceLocation::isValid().
Referenced by clang::ento::PathSensitiveBugReporter::emitReport().
|
inline |
Definition at line 167 of file AnalysisDeclContext.h.
D
is the std
C++ namespace. Definition at line 324 of file AnalysisDeclContext.cpp.
References D, clang::Decl::getDeclContext(), clang::DeclContext::getEnclosingNamespaceContext(), and Parent.
Referenced by clang::ento::LikelyFalsePositiveSuppressionBRVisitor::finalizeVisitor().
void AnalysisDeclContext::registerForcedBlockExpression | ( | const Stmt * | stmt | ) |
Definition at line 180 of file AnalysisDeclContext.cpp.
References clang::ast_matchers::stmt.