summaryrefslogtreecommitdiffstats
path: root/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2012-08-30 19:41:06 +0000
committerManuel Klimek <klimek@google.com>2012-08-30 19:41:06 +0000
commitfdf98763ace73b27a3a3a4200bef04b86a0f7b4e (patch)
treecc5aaa4e855e64d3e6e6403545a88b05b82b8aa3 /clang/lib/ASTMatchers/ASTMatchersInternal.cpp
parent4818bbe3489a1a940a592bd92223a4327c114472 (diff)
downloadbcm5719-llvm-fdf98763ace73b27a3a3a4200bef04b86a0f7b4e.tar.gz
bcm5719-llvm-fdf98763ace73b27a3a3a4200bef04b86a0f7b4e.zip
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. llvm-svn: 162936
Diffstat (limited to 'clang/lib/ASTMatchers/ASTMatchersInternal.cpp')
-rw-r--r--clang/lib/ASTMatchers/ASTMatchersInternal.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
index f69b3473194..e7ee8ee7ed3 100644
--- a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
+++ b/clang/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(
OpenPOWER on IntegriCloud