diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-20 15:08:46 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-20 15:08:46 +0000 |
commit | 36307ffa1b7d3a5975435a0e9ed874b10e153bfc (patch) | |
tree | 719b46a225e8ca274cb1b0bf0e0f7e99e48d3f9e /clang/lib/ASTMatchers/ASTMatchFinder.cpp | |
parent | c736863a85c511e29c4ac0f7a1b6cf0a749df18e (diff) | |
download | bcm5719-llvm-36307ffa1b7d3a5975435a0e9ed874b10e153bfc.tar.gz bcm5719-llvm-36307ffa1b7d3a5975435a0e9ed874b10e153bfc.zip |
[AST] Put TypeLocs and NestedNameSpecifierLocs into the ParentMap.
Firstly this changes the type of parent map to be keyed on DynTypedNode to
simplify the following changes. This comes with a DenseMapInfo for
DynTypedNode, which is a bit incomplete still and will probably only work
for parentmap right now.
Then the RecursiveASTVisitor in ASTContext is updated and finally
ASTMatchers hasParent and hasAncestor learn about the new functionality.
Now ParentMap is only missing TemplateArgumentLocs and CXXCtorInitializers.
Differential Revision: http://reviews.llvm.org/D13897
llvm-svn: 250831
Diffstat (limited to 'clang/lib/ASTMatchers/ASTMatchFinder.cpp')
-rw-r--r-- | clang/lib/ASTMatchers/ASTMatchFinder.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/ASTMatchers/ASTMatchFinder.cpp b/clang/lib/ASTMatchers/ASTMatchFinder.cpp index 8807b13c5ed..571e7dac240 100644 --- a/clang/lib/ASTMatchers/ASTMatchFinder.cpp +++ b/clang/lib/ASTMatchers/ASTMatchFinder.cpp @@ -621,9 +621,6 @@ private: if (Node.get<TranslationUnitDecl>() == ActiveASTContext->getTranslationUnitDecl()) return false; - assert(Node.getMemoizationData() && - "Invariant broken: only nodes that support memoization may be " - "used in the parent map."); MatchKey Key; Key.MatcherID = Matcher.getID(); @@ -867,7 +864,11 @@ bool MatchASTVisitor::TraverseNestedNameSpecifier(NestedNameSpecifier *NNS) { bool MatchASTVisitor::TraverseNestedNameSpecifierLoc( NestedNameSpecifierLoc NNS) { + if (!NNS) + return true; + match(NNS); + // We only match the nested name specifier here (as opposed to traversing it) // because the traversal is already done in the parallel "Loc"-hierarchy. if (NNS.hasQualifier()) |