diff options
author | Daniel Jasper <djasper@google.com> | 2012-11-15 03:29:05 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2012-11-15 03:29:05 +0000 |
commit | 0f9f019ff8fc6dcc7ae13328c60cc4164ae13782 (patch) | |
tree | 0a41e371f135321f37f929515df8d6506bfc38f2 /clang/lib/ASTMatchers/ASTMatchFinder.cpp | |
parent | 449eb3f3be77cc127617eaef3087e04a4307e203 (diff) | |
download | bcm5719-llvm-0f9f019ff8fc6dcc7ae13328c60cc4164ae13782.tar.gz bcm5719-llvm-0f9f019ff8fc6dcc7ae13328c60cc4164ae13782.zip |
Do not use data recursion in ASTMatchFinder.
The matchers rely on the complete AST being traversed as shown by the new test cases.
llvm-svn: 168022
Diffstat (limited to 'clang/lib/ASTMatchers/ASTMatchFinder.cpp')
-rw-r--r-- | clang/lib/ASTMatchers/ASTMatchFinder.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/ASTMatchers/ASTMatchFinder.cpp b/clang/lib/ASTMatchers/ASTMatchFinder.cpp index 6ff125bc835..04a2b353215 100644 --- a/clang/lib/ASTMatchers/ASTMatchFinder.cpp +++ b/clang/lib/ASTMatchers/ASTMatchFinder.cpp @@ -58,6 +58,9 @@ private: bool shouldVisitTemplateInstantiations() const { return true; } bool shouldVisitImplicitCode() const { return true; } + // Disables data recursion. We intercept Traverse* methods in the RAV, which + // are not triggered during data recursion. + bool shouldUseDataRecursionFor(clang::Stmt *S) const { return false; } template <typename T> bool TraverseNode(T *Node, bool (VisitorBase::*traverse)(T*)) { @@ -222,6 +225,9 @@ public: bool shouldVisitTemplateInstantiations() const { return true; } bool shouldVisitImplicitCode() const { return true; } + // Disables data recursion. We intercept Traverse* methods in the RAV, which + // are not triggered during data recursion. + bool shouldUseDataRecursionFor(clang::Stmt *S) const { return false; } private: // Used for updating the depth during traversal. @@ -471,6 +477,9 @@ public: bool shouldVisitTemplateInstantiations() const { return true; } bool shouldVisitImplicitCode() const { return true; } + // Disables data recursion. We intercept Traverse* methods in the RAV, which + // are not triggered during data recursion. + bool shouldUseDataRecursionFor(clang::Stmt *S) const { return false; } private: // Implements a BoundNodesTree::Visitor that calls a MatchCallback with |