clang 20.0.0git
Namespaces | Macros
ASTMatchFinder.cpp File Reference
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Timer.h"
#include <deque>
#include <memory>
#include <set>

Go to the source code of this file.

Namespaces

namespace  clang
 The JSON file list parser is used to communicate input to InstallAPI.
 
namespace  clang::ast_matchers
 
namespace  clang::ast_matchers::internal
 

Macros

#define CMD_TYPES_0
 
#define CMD_TYPES_1
 
#define IMPL(Index)
 

Macro Definition Documentation

◆ CMD_TYPES_0

#define CMD_TYPES_0
Value:
const QualType *, const TypeLoc *, const NestedNameSpecifier *, \
const NestedNameSpecifierLoc *

Definition at line 784 of file ASTMatchFinder.cpp.

◆ CMD_TYPES_1

#define CMD_TYPES_1
Value:
const CXXCtorInitializer *, const TemplateArgumentLoc *, const Attr *, \
const DynTypedNode *

Definition at line 787 of file ASTMatchFinder.cpp.

◆ IMPL

#define IMPL (   Index)
Value:
template <typename NodeType> \
std::enable_if_t< \
llvm::is_one_of<const NodeType *, CMD_TYPES_##Index>::value> \
SetCallbackAndRawNode(const MatchCallback *CB, const NodeType &N) { \
assertEmpty(); \
Callback.setPointerAndInt(CB, Index); \
Node##Index = &N; \
} \
\
template <typename T> \
std::enable_if_t<llvm::is_one_of<const T *, CMD_TYPES_##Index>::value, \
const T *> \
getNode() const { \
assertHoldsState(); \
return Callback.getInt() == (Index) ? Node##Index.dyn_cast<const T *>() \
: nullptr; \
}
DynTypedNode Node

Definition at line 791 of file ASTMatchFinder.cpp.

Variable Documentation

◆ BoundNodes

BoundNodesTreeBuilder BoundNodes

Definition at line 71 of file ASTMatchFinder.cpp.

◆ MatcherID

DynTypedMatcher::MatcherIDType MatcherID

◆ Node

DynTypedNode Node

Definition at line 70 of file ASTMatchFinder.cpp.

Referenced by clang::format::AnnotatedLine::addChildren(), clang::StoredDeclsList::addOrReplaceDecl(), clang::format::AnnotatedLine::AnnotatedLine(), clang::ast_matchers::AST_MATCHER(), clang::ast_matchers::AST_MATCHER_P(), clang::ast_matchers::AST_MATCHER_P2(), clang::ast_matchers::AST_MATCHER_P_OVERLOAD(), clang::ast_matchers::AST_MATCHER_REGEX(), clang::ast_matchers::AST_POLYMORPHIC_MATCHER(), clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P(), clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P2(), clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P_OVERLOAD(), clang::ast_matchers::AST_POLYMORPHIC_MATCHER_REGEX(), clang::dataflow::ASTMatchSwitchBuilder< BaseT, State, Result >::Build(), clang::internal::buildInterval(), clang::dataflow::ASTMatchSwitchBuilder< BaseT, State, Result >::CaseOf(), checkCommonAttributeFeatures(), llvm::GraphTraits< ModuleManager >::child_begin(), llvm::GraphTraits< ModuleManager >::child_end(), clang::ento::FieldChainInfo::contains(), clang::format::continuesLineCommentSection(), clang::DynTypedNode::create(), createDynTypedNode(), clang::tooling::fixit::createRemoval(), clang::StoredDeclsList::dump(), dump(), dumpBasePath(), clang::ento::CoreEngine::ExecuteWorkList(), fixUPCAddressofArraySubscriptWithSpan(), getAllVarBindingsForSymbol(), UPCPreIncrementGadget::getClaimedVarUseSites(), UUCAddAssignGadget::getClaimedVarUseSites(), clang::DynTypedNode::DenseMapInfo::getEmptyKey(), getEndCharLoc(), clang::tooling::getExtendedRange(), clang::tooling::getExtendedText(), UPCPreIncrementGadget::getFixits(), UUCAddAssignGadget::getFixits(), clang::tooling::CodeRangeASTSelection::getFunctionLikeNearestParent(), getLastStmt(), llvm::DOTGraphTraits< const CallGraph * >::getNodeLabel(), llvm::DOTGraphTraits< const CFG * >::getNodeLabel(), llvm::DOTGraphTraits< const Stmt * >::getNodeLabel(), clang::ast_matchers::internal::getNodeName(), clang::CallGraph::getOrInsertNode(), clang::ASTContext::getParents(), clang::ParentMapContext::getParents(), clang::ParentMapContext::ParentMap::getParents(), getPastLoc(), UPCPreIncrementGadget::getSourceLoc(), UUCAddAssignGadget::getSourceLoc(), clang::tooling::fixit::internal::getSourceRange(), clang::tooling::fixit::getText(), clang::tooling::getText(), clang::DynTypedNode::DenseMapInfo::getTombstoneKey(), hasAnyDirectChildrenWithKind(), clang::interp::InterpretOffsetOf(), clang::tooling::CodeRangeASTSelection::isInFunctionLikeBodyOfCode(), clang::sema::AnalysisBasedWarnings::IssueWarnings(), clang::ast_matchers::MatchFinder::match(), clang::ast_matchers::match(), clang::ast_matchers::matchDynamic(), clang::ast_matchers::internal::matchesAnyBase(), clang::transformer::member(), clang::transformer::name(), clang::transformer::node(), nodeToCommandLine(), clang::internal::partitionIntoIntervalsImpl(), clang::StoredDeclsList::prependDeclNoReplace(), PrintFloatingLiteral(), PrintIterator(), PrintMapper(), clang::ento::FieldChainInfo::printNoteMsg(), clang::ento::ExprEngine::processCallEnter(), clang::StoredDeclsList::replaceExternalDecls(), clang::transformer::detail::rewriteDescendants(), rewriteDescendantsImpl(), clang::tooling::ReplaceIfStmtWithItsBody::run(), clang::ast_matchers::selectFirst(), clang::tooling::RefactoringRuleContext::setASTSelection(), clang::transformer::statement(), clang::ast_matchers::MatchDescendantVisitor::TraverseCXXNoexceptExpr(), clang::ast_matchers::MatchDescendantVisitor::TraverseCXXTypeidExpr(), clang::ast_matchers::MatchDescendantVisitor::TraverseDecl(), clang::ast_matchers::MatchDescendantVisitor::TraverseDecltypeTypeLoc(), clang::ast_matchers::MatchDescendantVisitor::TraverseGenericSelectionExpr(), clang::ast_matchers::MatchDescendantVisitor::TraverseStmt(), clang::ast_matchers::MatchDescendantVisitor::TraverseTypeOfExprTypeLoc(), clang::ast_matchers::MatchDescendantVisitor::TraverseUnaryExprOrTypeTraitExpr(), UPCPreIncrementGadget::UPCPreIncrementGadget(), UUCAddAssignGadget::UUCAddAssignGadget(), clang::TextNodeDumper::Visit(), clang::ento::ExprEngine::Visit(), clang::TextNodeDumper::VisitAddrLabelExpr(), clang::ento::ExprEngine::VisitArrayInitLoopExpr(), clang::ento::ExprEngine::VisitArraySubscriptExpr(), clang::TextNodeDumper::VisitArrayTypeTraitExpr(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitAttributedStmt(), clang::TextNodeDumper::VisitBinaryOperator(), CallableVisitor::VisitBlockDecl(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitBlockExpr(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitCallExpr(), clang::TextNodeDumper::VisitCallExpr(), clang::UsedDeclVisitor< Derived >::VisitCapturedStmt(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitCapturedStmt(), clang::TextNodeDumper::VisitCaseStmt(), clang::TextNodeDumper::VisitCastExpr(), clang::TextNodeDumper::VisitCharacterLiteral(), clang::TextNodeDumper::VisitCoawaitExpr(), clang::TextNodeDumper::VisitCompoundAssignOperator(), clang::TextNodeDumper::VisitConceptSpecializationExpr(), clang::TextNodeDumper::VisitConstantExpr(), clang::TextNodeDumper::VisitCoreturnStmt(), clang::ento::ExprEngine::VisitCXXBindTemporaryExpr(), clang::TextNodeDumper::VisitCXXBindTemporaryExpr(), clang::TextNodeDumper::VisitCXXBoolLiteralExpr(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitCXXCatchStmt(), clang::TextNodeDumper::VisitCXXConstructExpr(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitCXXDefaultArgExpr(), clang::JSONNodeDumper::VisitCXXDefaultArgExpr(), clang::TextNodeDumper::VisitCXXDefaultArgExpr(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitCXXDefaultInitExpr(), clang::JSONNodeDumper::VisitCXXDefaultInitExpr(), clang::TextNodeDumper::VisitCXXDefaultInitExpr(), clang::TextNodeDumper::VisitCXXDeleteExpr(), clang::TextNodeDumper::VisitCXXDependentScopeMemberExpr(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitCXXForRangeStmt(), clang::TextNodeDumper::VisitCXXFunctionalCastExpr(), clang::TextNodeDumper::VisitCXXNamedCastExpr(), clang::TextNodeDumper::VisitCXXNewExpr(), clang::TextNodeDumper::VisitCXXOperatorCallExpr(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitCXXRewrittenBinaryOperator(), clang::TextNodeDumper::VisitCXXStaticCastExpr(), clang::TextNodeDumper::VisitCXXThisExpr(), clang::TextNodeDumper::VisitCXXUnresolvedConstructExpr(), clang::TextNodeDumper::VisitDeclRefExpr(), GlobalDeclRefChecker::VisitDeclRefExpr(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitDeclStmt(), clang::TextNodeDumper::VisitDependentScopeDeclRefExpr(), clang::TextNodeDumper::VisitExpressionTraitExpr(), clang::TextNodeDumper::VisitExprWithCleanups(), clang::TextNodeDumper::VisitExtVectorElementExpr(), clang::TextNodeDumper::VisitFixedPointLiteral(), clang::TextNodeDumper::VisitFloatingLiteral(), CallableVisitor::VisitFunctionDecl(), clang::TextNodeDumper::VisitGotoStmt(), clang::TextNodeDumper::VisitIfStmt(), clang::TextNodeDumper::VisitImplicitCastExpr(), clang::TextNodeDumper::VisitIntegerLiteral(), clang::TextNodeDumper::VisitLabelStmt(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitLambdaExpr(), CallableVisitor::VisitLambdaExpr(), clang::TextNodeDumper::VisitMaterializeTemporaryExpr(), clang::TextNodeDumper::VisitMemberExpr(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitObjCAtCatchStmt(), clang::TextNodeDumper::VisitObjCAtCatchStmt(), clang::TextNodeDumper::VisitObjCBoolLiteralExpr(), clang::TextNodeDumper::VisitObjCBoxedExpr(), clang::TextNodeDumper::VisitObjCEncodeExpr(), clang::TextNodeDumper::VisitObjCIvarRefExpr(), clang::TextNodeDumper::VisitObjCMessageExpr(), CallableVisitor::VisitObjCMethodDecl(), clang::TextNodeDumper::VisitObjCPropertyRefExpr(), clang::TextNodeDumper::VisitObjCProtocolExpr(), clang::TextNodeDumper::VisitObjCSelectorExpr(), clang::TextNodeDumper::VisitObjCSubscriptRefExpr(), clang::interp::Compiler< Emitter >::VisitOffsetOfExpr(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitOMPExecutableDirective(), clang::TextNodeDumper::VisitOMPIteratorExpr(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitOpaqueValueExpr(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitOpenACCConstructStmt(), clang::TextNodeDumper::VisitPredefinedExpr(), clang::TextNodeDumper::VisitRequiresExpr(), clang::TextNodeDumper::VisitReturnStmt(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitSizeOfPackExpr(), clang::TextNodeDumper::VisitSizeOfPackExpr(), clang::TextNodeDumper::VisitSwitchStmt(), clang::TextNodeDumper::VisitSYCLUniqueStableNameExpr(), clang::TextNodeDumper::VisitTypeTraitExpr(), clang::TextNodeDumper::VisitUnaryExprOrTypeTraitExpr(), clang::TextNodeDumper::VisitUnaryOperator(), clang::TextNodeDumper::VisitUnresolvedLookupExpr(), clang::TextNodeDumper::VisitWhileStmt(), and clang::Sema::~Sema().

◆ Node0

llvm::PointerUnion<CMD_TYPES_0> Node0

Definition at line 851 of file ASTMatchFinder.cpp.

◆ Node1

llvm::PointerUnion<CMD_TYPES_1> Node1

Definition at line 852 of file ASTMatchFinder.cpp.

◆ Nodes

BoundNodesTreeBuilder Nodes

◆ ResultOfMatch

bool ResultOfMatch

Definition at line 84 of file ASTMatchFinder.cpp.

◆ Traversal

TraversalKind Traversal = TK_AsIs

◆ Type

MatchType Type