diff options
-rw-r--r-- | clang/include/clang/ASTMatchers/ASTMatchersInternal.h | 2 | ||||
-rw-r--r-- | clang/lib/ASTMatchers/ASTMatchFinder.cpp | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h index e5365ff89d7..0d25810e0a2 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h +++ b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h @@ -537,6 +537,8 @@ public: Matcher, Builder, MatchMode); } + virtual ASTContext &getASTContext() const = 0; + protected: virtual bool matchesChildOf(const ast_type_traits::DynTypedNode &Node, const DynTypedMatcher &Matcher, diff --git a/clang/lib/ASTMatchers/ASTMatchFinder.cpp b/clang/lib/ASTMatchers/ASTMatchFinder.cpp index 04a2b353215..c13cf4a277f 100644 --- a/clang/lib/ASTMatchers/ASTMatchFinder.cpp +++ b/clang/lib/ASTMatchers/ASTMatchFinder.cpp @@ -475,6 +475,9 @@ public: return false; } + // Implements ASTMatchFinder::getASTContext. + virtual ASTContext &getASTContext() const { return *ActiveASTContext; } + bool shouldVisitTemplateInstantiations() const { return true; } bool shouldVisitImplicitCode() const { return true; } // Disables data recursion. We intercept Traverse* methods in the RAV, which |