23 #include "llvm/ADT/DenseMap.h"
24 #include "llvm/ADT/StringMap.h"
25 #include "llvm/Support/Timer.h"
31 namespace ast_matchers {
35 typedef MatchFinder::MatchCallback MatchCallback;
45 static const unsigned MaxMemoizationEntries = 10000;
61 ast_type_traits::DynTypedNode
Node;
64 bool operator<(
const MatchKey &Other)
const {
66 std::tie(Other.MatcherID, Other.Node, Other.BoundNodes);
71 struct MemoizedMatchResult {
78 class MatchChildASTVisitor
79 :
public RecursiveASTVisitor<MatchChildASTVisitor> {
81 typedef RecursiveASTVisitor<MatchChildASTVisitor> VisitorBase;
87 MatchChildASTVisitor(
const DynTypedMatcher *
Matcher,
92 ASTMatchFinder::BindKind
Bind)
113 bool findMatch(
const ast_type_traits::DynTypedNode &DynNode) {
115 if (
const Decl *D = DynNode.get<Decl>())
117 else if (
const Stmt *
S = DynNode.get<Stmt>())
119 else if (
const NestedNameSpecifier *NNS =
120 DynNode.get<NestedNameSpecifier>())
122 else if (
const NestedNameSpecifierLoc *NNSLoc =
123 DynNode.get<NestedNameSpecifierLoc>())
125 else if (
const QualType *Q = DynNode.get<QualType>())
127 else if (
const TypeLoc *T = DynNode.get<TypeLoc>())
129 else if (
const auto *C = DynNode.get<CXXCtorInitializer>())
144 bool TraverseDecl(Decl *DeclNode) {
146 return (DeclNode ==
nullptr) || traverse(*DeclNode);
148 bool TraverseStmt(Stmt *StmtNode) {
150 const Stmt *StmtToTraverse = StmtNode;
152 ASTMatchFinder::TK_IgnoreImplicitCastsAndParentheses) {
153 const Expr *ExprNode = dyn_cast_or_null<Expr>(StmtNode);
155 StmtToTraverse = ExprNode->IgnoreParenImpCasts();
158 return (StmtToTraverse ==
nullptr) || traverse(*StmtToTraverse);
162 bool TraverseType(QualType TypeNode) {
163 if (TypeNode.isNull())
167 if (!
match(*TypeNode))
170 return traverse(TypeNode);
174 bool TraverseTypeLoc(TypeLoc TypeLocNode) {
175 if (TypeLocNode.isNull())
179 if (!
match(*TypeLocNode.getType()))
182 if (!
match(TypeLocNode.getType()))
185 return traverse(TypeLocNode);
187 bool TraverseNestedNameSpecifier(NestedNameSpecifier *NNS) {
189 return (NNS ==
nullptr) || traverse(*NNS);
191 bool TraverseNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS) {
195 if (!
match(*NNS.getNestedNameSpecifier()))
197 return traverse(NNS);
199 bool TraverseConstructorInitializer(CXXCtorInitializer *CtorInit) {
203 return traverse(*CtorInit);
206 bool shouldVisitTemplateInstantiations()
const {
return true; }
207 bool shouldVisitImplicitCode()
const {
return true; }
211 struct ScopedIncrement {
212 explicit ScopedIncrement(
int *
Depth) : Depth(Depth) { ++(*Depth); }
213 ~ScopedIncrement() { --(*Depth); }
227 bool baseTraverse(
const Decl &DeclNode) {
230 bool baseTraverse(
const Stmt &StmtNode) {
233 bool baseTraverse(QualType TypeNode) {
236 bool baseTraverse(TypeLoc TypeLocNode) {
239 bool baseTraverse(
const NestedNameSpecifier &NNS) {
241 const_cast<NestedNameSpecifier*>(&NNS));
243 bool baseTraverse(NestedNameSpecifierLoc NNS) {
246 bool baseTraverse(
const CXXCtorInitializer &CtorInit) {
248 const_cast<CXXCtorInitializer *>(&CtorInit));
256 template <
typename T>
261 if (Bind != ASTMatchFinder::BK_All) {
262 BoundNodesTreeBuilder RecursiveBuilder(*Builder);
264 &RecursiveBuilder)) {
270 BoundNodesTreeBuilder RecursiveBuilder(*Builder);
272 &RecursiveBuilder)) {
283 template <
typename T>
284 bool traverse(
const T &Node) {
285 static_assert(IsBaseType<T>::value,
286 "traverse can only be instantiated with base type");
289 return baseTraverse(Node);
299 const ASTMatchFinder::BindKind
Bind;
305 class MatchASTVisitor :
public RecursiveASTVisitor<MatchASTVisitor>,
306 public ASTMatchFinder {
308 MatchASTVisitor(
const MatchFinder::MatchersByType *
Matchers,
309 const MatchFinder::MatchFinderOptions &
Options)
312 ~MatchASTVisitor()
override {
313 if (Options.CheckProfiling) {
314 Options.CheckProfiling->Records = std::move(
TimeByBucket);
318 void onStartOfTranslationUnit() {
319 const bool EnableCheckProfiling = Options.CheckProfiling.hasValue();
320 TimeBucketRegion Timer;
321 for (MatchCallback *MC : Matchers->AllCallbacks) {
322 if (EnableCheckProfiling)
324 MC->onStartOfTranslationUnit();
328 void onEndOfTranslationUnit() {
329 const bool EnableCheckProfiling = Options.CheckProfiling.hasValue();
330 TimeBucketRegion Timer;
331 for (MatchCallback *MC : Matchers->AllCallbacks) {
332 if (EnableCheckProfiling)
334 MC->onEndOfTranslationUnit();
338 void set_active_ast_context(ASTContext *NewActiveASTContext) {
345 bool VisitTypedefNameDecl(TypedefNameDecl *DeclNode) {
373 const Type *TypeNode = DeclNode->getUnderlyingType().getTypePtr();
374 const Type *CanonicalType =
380 bool TraverseDecl(Decl *DeclNode);
381 bool TraverseStmt(Stmt *StmtNode);
382 bool TraverseType(QualType TypeNode);
383 bool TraverseTypeLoc(TypeLoc TypeNode);
384 bool TraverseNestedNameSpecifier(NestedNameSpecifier *NNS);
385 bool TraverseNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS);
386 bool TraverseConstructorInitializer(CXXCtorInitializer *CtorInit);
389 bool memoizedMatchesRecursively(
const ast_type_traits::DynTypedNode &Node,
390 const DynTypedMatcher &Matcher,
391 BoundNodesTreeBuilder *Builder,
int MaxDepth,
392 TraversalKind Traversal, BindKind Bind) {
394 if (!Node.getMemoizationData() || !Builder->isComparable())
395 return matchesRecursively(Node, Matcher, Builder, MaxDepth, Traversal,
399 Key.MatcherID = Matcher.getID();
406 *Builder = I->second.Nodes;
407 return I->second.ResultOfMatch;
410 MemoizedMatchResult
Result;
412 Result.ResultOfMatch = matchesRecursively(Node, Matcher, &Result.Nodes,
413 MaxDepth, Traversal, Bind);
415 MemoizedMatchResult &CachedResult =
ResultCache[Key];
416 CachedResult = std::move(Result);
418 *Builder = CachedResult.Nodes;
419 return CachedResult.ResultOfMatch;
423 bool matchesRecursively(
const ast_type_traits::DynTypedNode &Node,
424 const DynTypedMatcher &Matcher,
425 BoundNodesTreeBuilder *Builder,
int MaxDepth,
426 TraversalKind Traversal, BindKind Bind) {
427 MatchChildASTVisitor Visitor(
428 &Matcher,
this, Builder, MaxDepth, Traversal, Bind);
429 return Visitor.findMatch(Node);
432 bool classIsDerivedFrom(
const CXXRecordDecl *Declaration,
433 const Matcher<NamedDecl> &
Base,
434 BoundNodesTreeBuilder *Builder)
override;
437 bool matchesChildOf(
const ast_type_traits::DynTypedNode &Node,
438 const DynTypedMatcher &Matcher,
439 BoundNodesTreeBuilder *Builder,
440 TraversalKind Traversal,
441 BindKind Bind)
override {
444 return memoizedMatchesRecursively(Node, Matcher, Builder, 1, Traversal,
448 bool matchesDescendantOf(
const ast_type_traits::DynTypedNode &Node,
449 const DynTypedMatcher &Matcher,
450 BoundNodesTreeBuilder *Builder,
451 BindKind Bind)
override {
454 return memoizedMatchesRecursively(Node, Matcher, Builder,
INT_MAX,
458 bool matchesAncestorOf(
const ast_type_traits::DynTypedNode &Node,
459 const DynTypedMatcher &Matcher,
460 BoundNodesTreeBuilder *Builder,
461 AncestorMatchMode MatchMode)
override {
466 return memoizedMatchesAncestorOfRecursively(Node, Matcher, Builder,
472 void match(
const ast_type_traits::DynTypedNode &Node) {
474 if (
auto *N = Node.get<Decl>()) {
476 }
else if (
auto *N = Node.get<Stmt>()) {
478 }
else if (
auto *N = Node.get<Type>()) {
480 }
else if (
auto *N = Node.get<QualType>()) {
482 }
else if (
auto *N = Node.get<NestedNameSpecifier>()) {
484 }
else if (
auto *N = Node.get<NestedNameSpecifierLoc>()) {
486 }
else if (
auto *N = Node.get<TypeLoc>()) {
488 }
else if (
auto *N = Node.get<CXXCtorInitializer>()) {
493 template <
typename T>
void match(
const T &Node) {
494 matchDispatch(&Node);
500 bool shouldVisitTemplateInstantiations()
const {
return true; }
501 bool shouldVisitImplicitCode()
const {
return true; }
504 class TimeBucketRegion {
506 TimeBucketRegion() :
Bucket(nullptr) {}
507 ~TimeBucketRegion() { setBucket(
nullptr); }
517 void setBucket(llvm::TimeRecord *NewBucket) {
518 if (
Bucket != NewBucket) {
519 auto Now = llvm::TimeRecord::getCurrentTime(
true);
535 template <
typename T,
typename MC>
536 void matchWithoutFilter(
const T &Node,
const MC &Matchers) {
537 const bool EnableCheckProfiling = Options.CheckProfiling.hasValue();
538 TimeBucketRegion Timer;
539 for (
const auto &MP : Matchers) {
540 if (EnableCheckProfiling)
543 if (MP.first.matches(Node,
this, &Builder)) {
545 Builder.visitMatches(&Visitor);
550 void matchWithFilter(
const ast_type_traits::DynTypedNode &DynNode) {
551 auto Kind = DynNode.getNodeKind();
559 const bool EnableCheckProfiling = Options.CheckProfiling.hasValue();
560 TimeBucketRegion Timer;
561 auto &Matchers = this->Matchers->DeclOrStmt;
562 for (
unsigned short I : Filter) {
563 auto &MP = Matchers[
I];
564 if (EnableCheckProfiling)
567 if (MP.first.matchesNoKindCheck(DynNode,
this, &Builder)) {
569 Builder.visitMatches(&Visitor);
574 const std::vector<unsigned short> &
575 getFilterForKind(ast_type_traits::ASTNodeKind
Kind) {
577 auto &Matchers = this->Matchers->DeclOrStmt;
578 assert((Matchers.size() <
USHRT_MAX) &&
"Too many matchers.");
579 for (
unsigned I = 0,
E = Matchers.size(); I !=
E; ++
I) {
580 if (Matchers[I].first.canMatchNodesOfKind(Kind)) {
589 void matchDispatch(
const Decl *Node) {
592 void matchDispatch(
const Stmt *Node) {
596 void matchDispatch(
const Type *Node) {
597 matchWithoutFilter(QualType(Node, 0), Matchers->Type);
599 void matchDispatch(
const TypeLoc *Node) {
600 matchWithoutFilter(*Node, Matchers->TypeLoc);
602 void matchDispatch(
const QualType *Node) {
603 matchWithoutFilter(*Node, Matchers->Type);
605 void matchDispatch(
const NestedNameSpecifier *Node) {
606 matchWithoutFilter(*Node, Matchers->NestedNameSpecifier);
608 void matchDispatch(
const NestedNameSpecifierLoc *Node) {
609 matchWithoutFilter(*Node, Matchers->NestedNameSpecifierLoc);
611 void matchDispatch(
const CXXCtorInitializer *Node) {
612 matchWithoutFilter(*Node, Matchers->CtorInit);
614 void matchDispatch(
const void *) { }
630 bool memoizedMatchesAncestorOfRecursively(
631 const ast_type_traits::DynTypedNode &Node,
const DynTypedMatcher &Matcher,
632 BoundNodesTreeBuilder *Builder, AncestorMatchMode MatchMode) {
633 if (Node.get<TranslationUnitDecl>() ==
638 if (!Builder->isComparable())
639 return matchesAncestorOfRecursively(Node, Matcher, Builder, MatchMode);
642 Key.MatcherID = Matcher.getID();
648 MemoizationMap::iterator I =
ResultCache.find(Key);
650 *Builder = I->second.Nodes;
651 return I->second.ResultOfMatch;
654 MemoizedMatchResult
Result;
656 Result.ResultOfMatch =
657 matchesAncestorOfRecursively(Node, Matcher, &Result.Nodes, MatchMode);
659 MemoizedMatchResult &CachedResult =
ResultCache[Key];
660 CachedResult = std::move(Result);
662 *Builder = CachedResult.Nodes;
663 return CachedResult.ResultOfMatch;
666 bool matchesAncestorOfRecursively(
const ast_type_traits::DynTypedNode &Node,
667 const DynTypedMatcher &Matcher,
668 BoundNodesTreeBuilder *Builder,
669 AncestorMatchMode MatchMode) {
671 assert(!Parents.empty() &&
"Found node that is not in the parent map.");
672 if (Parents.size() == 1) {
674 const ast_type_traits::DynTypedNode Parent = Parents[0];
675 BoundNodesTreeBuilder BuilderCopy = *
Builder;
676 if (Matcher.matches(Parent,
this, &BuilderCopy)) {
677 *Builder = std::move(BuilderCopy);
680 if (MatchMode != ASTMatchFinder::AMM_ParentOnly) {
681 return memoizedMatchesAncestorOfRecursively(Parent, Matcher, Builder,
689 std::deque<ast_type_traits::DynTypedNode> Queue(Parents.begin(),
691 while (!Queue.empty()) {
692 BoundNodesTreeBuilder BuilderCopy = *
Builder;
693 if (Matcher.matches(Queue.front(),
this, &BuilderCopy)) {
694 *Builder = std::move(BuilderCopy);
697 if (MatchMode != ASTMatchFinder::AMM_ParentOnly) {
698 for (
const auto &Parent :
703 if (Visited.insert(Parent.getMemoizationData()).second)
704 Queue.push_back(Parent);
715 class MatchVisitor :
public BoundNodesTreeBuilder::Visitor {
717 MatchVisitor(ASTContext*
Context,
718 MatchFinder::MatchCallback*
Callback)
720 Callback(Callback) {}
722 void visitMatch(
const BoundNodes& BoundNodesView)
override {
732 bool typeHasMatchingAlias(
const Type *TypeNode,
733 const Matcher<NamedDecl> &Matcher,
734 BoundNodesTreeBuilder *Builder) {
735 const Type *
const CanonicalType =
737 for (
const TypedefNameDecl *Alias :
TypeAliases.lookup(CanonicalType)) {
738 BoundNodesTreeBuilder
Result(*Builder);
739 if (Matcher.matches(*Alias,
this, &Result)) {
740 *Builder = std::move(Result);
762 llvm::DenseMap<ast_type_traits::ASTNodeKind, std::vector<unsigned short>>
765 const MatchFinder::MatchFinderOptions &
Options;
769 llvm::DenseMap<const Type*, std::set<const TypedefNameDecl*> >
TypeAliases;
772 typedef std::map<MatchKey, MemoizedMatchResult> MemoizationMap;
776 static CXXRecordDecl *
777 getAsCXXRecordDeclOrPrimaryTemplate(
const Type *TypeNode) {
778 if (
auto *RD = TypeNode->getAsCXXRecordDecl())
782 auto *TemplateType = TypeNode->getAs<TemplateSpecializationType>();
783 while (TemplateType && TemplateType->isTypeAlias())
785 TemplateType->getAliasedType()->getAs<TemplateSpecializationType>();
790 if (
auto *ClassTemplate = dyn_cast_or_null<ClassTemplateDecl>(
791 TemplateType->getTemplateName().getAsTemplateDecl()))
792 return ClassTemplate->getTemplatedDecl();
800 bool MatchASTVisitor::classIsDerivedFrom(
const CXXRecordDecl *Declaration,
801 const Matcher<NamedDecl> &
Base,
802 BoundNodesTreeBuilder *Builder) {
803 if (!Declaration->hasDefinition())
805 for (
const auto &It : Declaration->bases()) {
806 const Type *TypeNode = It.getType().getTypePtr();
808 if (typeHasMatchingAlias(TypeNode, Base, Builder))
814 CXXRecordDecl *ClassDecl = getAsCXXRecordDeclOrPrimaryTemplate(TypeNode);
817 if (ClassDecl == Declaration) {
822 BoundNodesTreeBuilder
Result(*Builder);
823 if (Base.matches(*ClassDecl,
this, &Result)) {
824 *Builder = std::move(Result);
827 if (classIsDerivedFrom(ClassDecl, Base, Builder))
833 bool MatchASTVisitor::TraverseDecl(Decl *DeclNode) {
841 bool MatchASTVisitor::TraverseStmt(Stmt *StmtNode) {
849 bool MatchASTVisitor::TraverseType(QualType TypeNode) {
854 bool MatchASTVisitor::TraverseTypeLoc(TypeLoc TypeLocNode) {
861 match(TypeLocNode.getType());
865 bool MatchASTVisitor::TraverseNestedNameSpecifier(NestedNameSpecifier *NNS) {
870 bool MatchASTVisitor::TraverseNestedNameSpecifierLoc(
871 NestedNameSpecifierLoc NNS) {
879 if (NNS.hasQualifier())
880 match(*NNS.getNestedNameSpecifier());
885 bool MatchASTVisitor::TraverseConstructorInitializer(
886 CXXCtorInitializer *CtorInit) {
896 class MatchASTConsumer :
public ASTConsumer {
898 MatchASTConsumer(MatchFinder *Finder,
900 : Finder(Finder), ParsingDone(ParsingDone) {}
903 void HandleTranslationUnit(ASTContext &
Context)
override {
907 Finder->matchAST(Context);
919 : Nodes(Nodes), Context(Context),
926 : Options(std::move(Options)), ParsingDone(nullptr) {}
932 Matchers.DeclOrStmt.emplace_back(NodeMatch, Action);
933 Matchers.AllCallbacks.insert(Action);
938 Matchers.Type.emplace_back(NodeMatch, Action);
939 Matchers.AllCallbacks.insert(Action);
944 Matchers.DeclOrStmt.emplace_back(NodeMatch, Action);
945 Matchers.AllCallbacks.insert(Action);
950 Matchers.NestedNameSpecifier.emplace_back(NodeMatch, Action);
951 Matchers.AllCallbacks.insert(Action);
956 Matchers.NestedNameSpecifierLoc.emplace_back(NodeMatch, Action);
957 Matchers.AllCallbacks.insert(Action);
962 Matchers.TypeLoc.emplace_back(NodeMatch, Action);
963 Matchers.AllCallbacks.insert(Action);
968 Matchers.CtorInit.emplace_back(NodeMatch, Action);
969 Matchers.AllCallbacks.insert(Action);
974 if (NodeMatch.canConvertTo<
Decl>()) {
977 }
else if (NodeMatch.canConvertTo<
QualType>()) {
980 }
else if (NodeMatch.canConvertTo<
Stmt>()) {
989 }
else if (NodeMatch.canConvertTo<
TypeLoc>()) {
1000 return llvm::make_unique<internal::MatchASTConsumer>(
this, ParsingDone);
1005 internal::MatchASTVisitor Visitor(&Matchers, Options);
1006 Visitor.set_active_ast_context(&Context);
1007 Visitor.match(Node);
1011 internal::MatchASTVisitor Visitor(&Matchers, Options);
1012 Visitor.set_active_ast_context(&Context);
1013 Visitor.onStartOfTranslationUnit();
1015 Visitor.onEndOfTranslationUnit();
1020 ParsingDone = NewParsingDone;
Defines the clang::ASTContext interface.
const MatchFinder::MatchersByType * Matchers
A (possibly-)qualified type.
Stmt - This represents one statement.
MatchFinder::ParsingDoneTestCallback * ParsingDone
Decl - This represents one declaration (or definition), e.g.
internal::Matcher< Decl > DeclarationMatcher
Types of matchers for the top-level classes in the AST class hierarchy.
internal::Matcher< CXXCtorInitializer > CXXCtorInitializerMatcher
const DynTypedMatcher *const Matcher
Called when parsing is finished. Intended for testing only.
MatchFinder(MatchFinderOptions Options=MatchFinderOptions())
BoundNodesTreeBuilder Nodes
bool TraverseDecl(Decl *D)
Recursively visit a declaration, by dispatching to Traverse*Decl() based on the argument's dynamic ty...
Base wrapper for a particular "section" of type source info.
virtual ~ParsingDoneTestCallback()
void match(const T &Node, ASTContext &Context)
Calls the registered callbacks on all matches on the given Node.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
const ASTMatchFinder::BindKind Bind
ASTContext * ActiveASTContext
void addMatcher(const DeclarationMatcher &NodeMatch, MatchCallback *Action)
Adds a matcher to execute when running over the AST.
SmallVector< BoundNodes, 1 > match(MatcherT Matcher, const NodeT &Node, ASTContext &Context)
Returns the results of matching Matcher on Node.
internal::Matcher< Stmt > StatementMatcher
detail::InMemoryDirectory::const_iterator I
BoundNodesTreeBuilder ResultBindings
DynTypedMatcher::MatcherIDType MatcherID
internal::Matcher< NestedNameSpecifierLoc > NestedNameSpecifierLocMatcher
virtual StringRef getID() const
An id used to group the matchers.
bool TraverseConstructorInitializer(CXXCtorInitializer *Init)
Recursively visit a constructor initializer.
MatchFinder::MatchCallback * Callback
TranslationUnitDecl * getTranslationUnitDecl() const
llvm::DenseMap< ast_type_traits::ASTNodeKind, std::vector< unsigned short > > MatcherFiltersMap
Filtered list of matcher indices for each matcher kind.
void registerTestCallbackAfterParsing(ParsingDoneTestCallback *ParsingDone)
Registers a callback to notify the end of parsing.
MatchResult(const BoundNodes &Nodes, clang::ASTContext *Context)
std::unique_ptr< clang::ASTConsumer > newASTConsumer()
Creates a clang ASTConsumer that finds all matches.
The l-value was considered opaque, so the alignment was determined from a type.
Maps string IDs to AST nodes matched by parts of a matcher.
const MatchFinder::MatchFinderOptions & Options
ASTMatchFinder *const Finder
bool TraverseTypeLoc(TypeLoc TL)
Recursively visit a type with location, by dispatching to Traverse*TypeLoc() based on the argument ty...
bool TraverseNestedNameSpecifierLoc(NestedNameSpecifierLoc NNS)
Recursively visit a C++ nested-name-specifier with location information.
const ASTMatchFinder::TraversalKind Traversal
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
internal::Matcher< TypeLoc > TypeLocMatcher
void matchAST(ASTContext &Context)
Finds all matches in the given AST.
bool TraverseStmt(Stmt *S, DataRecursionQueue *Queue=nullptr)
Recursively visit a statement or expression, by dispatching to Traverse*() based on the argument's dy...
bool operator<(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
bool TraverseType(QualType T)
Recursively visit a type, by dispatching to Traverse*Type() based on the argument's getTypeClass() pr...
static DynTypedNode create(const T &Node)
Creates a DynTypedNode from Node.
BoundNodesTreeBuilder BoundNodes
ast_type_traits::DynTypedNode Node
internal::Matcher< NestedNameSpecifier > NestedNameSpecifierMatcher
detail::InMemoryDirectory::const_iterator E
A dynamically typed AST node container.
Represents a C++ base or member initializer.
bool TraverseNestedNameSpecifier(NestedNameSpecifier *NNS)
Recursively visit a C++ nested-name-specifier.
MemoizationMap ResultCache
internal::Matcher< QualType > TypeMatcher
BoundNodesTreeBuilder *const Builder
llvm::DenseMap< const Type *, std::set< const TypedefNameDecl * > > TypeAliases
This class handles loading and caching of source files into memory.
bool addDynamicMatcher(const internal::DynTypedMatcher &NodeMatch, MatchCallback *Action)
Adds a matcher to execute when running over the AST.
llvm::StringMap< llvm::TimeRecord > TimeByBucket
Bucket to record map.
llvm::TimeRecord * Bucket