clang 22.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 60 of file AnalysisDeclContext.cpp.
AnalysisDeclContext::AnalysisDeclContext | ( | AnalysisDeclContextManager * | Mgr, |
const Decl * | D, | ||
const CFG::BuildOptions & | BuildOptions ) |
Definition at line 53 of file AnalysisDeclContext.cpp.
AnalysisDeclContext::~AnalysisDeclContext | ( | ) |
Definition at line 683 of file AnalysisDeclContext.cpp.
void AnalysisDeclContext::dumpCFG | ( | bool | ShowColors | ) |
Definition at line 272 of file AnalysisDeclContext.cpp.
References clang::CFG::dump(), getASTContext(), and getCFG().
|
inline |
Definition at line 119 of file AnalysisDeclContext.h.
Referenced by CheckFallThrough().
|
inline |
Definition at line 123 of file AnalysisDeclContext.h.
|
inline |
Definition at line 124 of file AnalysisDeclContext.h.
Definition at line 192 of file AnalysisDeclContext.h.
References clang::T.
Referenced by clang::lifetimes::internal::FactManager::dump(), clang::threadSafety::CFGWalker::init(), and clang::consumed::ConsumedAnalyzer::run().
|
inline |
Definition at line 104 of file AnalysisDeclContext.h.
Referenced by areAllValuesNoReturn(), clang::ento::SValBuilder::conjureSymbolVal(), dumpCFG(), clang::LocationContext::dumpStack(), clang::reachable_code::FindUnreachableCode(), clang::ento::getWidenedLoopState(), clang::ento::isPossiblyEscaped(), printIndicesOfElementsToConstructJson(), clang::LocationContext::printJson(), clang::ProgramPoint::printJson(), printObjectsUnderConstructionJson(), printPendingInitLoopJson(), clang::consumed::ConsumedAnalyzer::run(), and timeTraceMetadata().
Definition at line 188 of file AnalysisDeclContext.cpp.
References clang::ast_matchers::stmt.
Referenced by clang::sema::AnalysisBasedWarnings::IssueWarnings().
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 316 of file AnalysisDeclContext.cpp.
References clang::Data.
Stmt * AnalysisDeclContext::getBody | ( | ) | const |
D
. Definition at line 124 of file AnalysisDeclContext.cpp.
References getBody().
Referenced by DiagnoseSwitchLabelsFallthrough(), 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 91 of file AnalysisDeclContext.cpp.
CFG * AnalysisDeclContext::getCFG | ( | ) |
Definition at line 211 of file AnalysisDeclContext.cpp.
References addParentsForSyntheticStmts(), clang::CFG::buildCFG(), getBody(), getCFGBuildOptions(), getUnoptimizedCFG(), and clang::CFG::BuildOptions::Observer.
Referenced by areAllValuesNoReturn(), CheckFallThrough(), checkRecursiveFunction(), checkThrowInNonThrowingFunc(), clang::LiveVariables::computeLiveness(), clang::PostOrderCFGView::create(), DiagnoseSwitchLabelsFallthrough(), dumpCFG(), clang::reachable_code::FindUnreachableCode(), getCFGReachablityAnalysis(), getCFGStmtMap(), getParentMap(), clang::threadSafety::CFGWalker::init(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), clang::consumed::ConsumedAnalyzer::run(), and clang::LiveVariables::runOnAllBlocks().
|
inline |
Definition at line 110 of file AnalysisDeclContext.h.
Referenced by clang::reachable_code::FindUnreachableCode(), getCFG(), getUnoptimizedCFG(), and clang::sema::AnalysisBasedWarnings::IssueWarnings().
|
inline |
Definition at line 112 of file AnalysisDeclContext.h.
CFGReverseBlockReachabilityAnalysis * AnalysisDeclContext::getCFGReachablityAnalysis | ( | ) |
Definition at line 260 of file AnalysisDeclContext.cpp.
Referenced by clang::sema::AnalysisBasedWarnings::IssueWarnings().
CFGStmtMap * AnalysisDeclContext::getCFGStmtMap | ( | ) |
Definition at line 248 of file AnalysisDeclContext.cpp.
References clang::CFGStmtMap::Build(), c, getCFG(), and getParentMap().
Referenced by clang::ento::ExplodedNode::getCFGBlock(), and clang::ento::SuppressInlineDefensiveChecksVisitor::VisitNode().
|
inline |
Definition at line 106 of file AnalysisDeclContext.h.
Referenced by CheckUnreachable(), DiagnoseSwitchLabelsFallthrough(), clang::lifetimes::internal::FactManager::dump(), emitDiagnostics(), emitDiagnostics(), emitDiagnostics(), getLocationForCaller(), getParentMap(), clang::ento::AnyFunctionCall::getRuntimeDefinition(), clang::ento::PathDiagnosticLocation::getValidSourceLocation(), clang::threadSafety::CFGWalker::init(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), and clang::consumed::ConsumedAnalyzer::run().
|
static |
Definition at line 337 of file AnalysisDeclContext.cpp.
References clang::PresumedLoc::getColumn(), clang::ASTContext::getLangOpts(), clang::PresumedLoc::getLine(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getSourceManager(), clang::isa(), and clang::PresumedLoc::isValid().
Referenced by clang::LocationContext::dumpStack(), and clang::ProgramPoint::printJson().
|
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 276 of file AnalysisDeclContext.cpp.
References addParentsForSyntheticStmts(), clang::C, getBody(), getCFG(), getDecl(), and getUnoptimizedCFG().
Referenced by getCFGStmtMap(), clang::ento::PathDiagnosticLocation::getValidSourceLocation(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), and shouldRemoveDeadBindings().
llvm::iterator_range< AnalysisDeclContext::referenced_decls_iterator > AnalysisDeclContext::getReferencedBlockVars | ( | const BlockDecl * | BD | ) |
Definition at line 661 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 146 of file AnalysisDeclContext.cpp.
References clang::CXXRecordDecl::captures(), clang::DeclContext::getParent(), clang::CXXRecordDecl::isLambda(), and isSelfDecl().
Referenced by clang::ento::ObjCMethodCall::getInitialStackFrameContents(), 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 309 of file AnalysisDeclContext.cpp.
References clang::LocationContext::getStackFrame().
CFG * AnalysisDeclContext::getUnoptimizedCFG | ( | ) |
Definition at line 230 of file AnalysisDeclContext.cpp.
References addParentsForSyntheticStmts(), clang::CFG::buildCFG(), getBody(), getCFGBuildOptions(), and clang::CFG::BuildOptions::Observer.
Referenced by getCFG(), and getParentMap().
|
inline |
Definition at line 120 of file AnalysisDeclContext.h.
bool AnalysisDeclContext::isBodyAutosynthesized | ( | ) | const |
Definition at line 129 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 135 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.
Referenced by clang::sema::AnalysisBasedWarnings::IssueWarnings().
D
is the std
C++ namespace. Definition at line 322 of file AnalysisDeclContext.cpp.
References clang::cast(), clang::DeclContext::getEnclosingNamespaceContext(), clang::DeclContext::getParent(), and clang::isa().
Referenced by clang::ento::LikelyFalsePositiveSuppressionBRVisitor::finalizeVisitor().
void AnalysisDeclContext::registerForcedBlockExpression | ( | const Stmt * | stmt | ) |
Definition at line 178 of file AnalysisDeclContext.cpp.
References clang::ast_matchers::stmt.
Referenced by clang::sema::AnalysisBasedWarnings::IssueWarnings().