diff options
author | Manuel Klimek <klimek@google.com> | 2012-08-30 19:41:06 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2012-08-30 19:41:06 +0000 |
commit | 66341c596f93d0c6475d839db94072b8ebd1cf5b (patch) | |
tree | 1c6909fbfa8ff6839dff0693359f04bb4babc65a /lib | |
parent | 05fcbd3dc28f4cba4a6d33e7aeaabb5f6f7837e3 (diff) |
Fixes a bug for binding memoized match results.
Intorduces an abstraction for DynTypedNode which makes
is impossible to create in ways that introduced the bug;
also hides the implementation details of the template
magic away from the user and prepares the code for adding
QualType and TypeLoc bindings, as well as using DynTypedNode
instead of overloads for child and ancestor matching.
getNodeAs<T> was changed towards a non-pointer type, as
we'll want QualType and TypeLoc nodes to be returned
by value (the alternative would be to create new storage
which is prohibitively costly if we want to use it for
child / ancestor matching).
DynTypedNode is moved into a new header ASTTypeTraits.h,
as it is completely independent of the rest of the matcher
infrastructure - if the need comes up, we can move it to
a more common place.
The interface for users before the introduction of the
common storage change remains the same, minus the introduced
bug, for which a regression test was added.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162936 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ASTMatchers/ASTMatchersInternal.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/ASTMatchers/ASTMatchersInternal.cpp b/lib/ASTMatchers/ASTMatchersInternal.cpp index f69b347319..e7ee8ee7ed 100644 --- a/lib/ASTMatchers/ASTMatchersInternal.cpp +++ b/lib/ASTMatchers/ASTMatchersInternal.cpp @@ -22,7 +22,7 @@ void BoundNodesMap::copyTo(BoundNodesTreeBuilder *Builder) const { for (IDToNodeMap::const_iterator It = NodeMap.begin(); It != NodeMap.end(); ++It) { - Builder->setBinding(It->first, It->second.second); + Builder->setBinding(It->first, It->second); } } @@ -31,7 +31,6 @@ void BoundNodesMap::copyTo(BoundNodesMap *Other) const { inserter(Other->NodeMap, Other->NodeMap.begin())); } - BoundNodesTree::BoundNodesTree() {} BoundNodesTree::BoundNodesTree( |