diff options
Diffstat (limited to 'clang/lib/ASTMatchers/ASTMatchersInternal.cpp')
-rw-r--r-- | clang/lib/ASTMatchers/ASTMatchersInternal.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp index e7ee8ee7ed3..408195d3690 100644 --- a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp +++ b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp @@ -51,19 +51,20 @@ void BoundNodesTree::copyTo(BoundNodesTreeBuilder* Builder) const { void BoundNodesTree::visitMatches(Visitor* ResultVisitor) { BoundNodesMap AggregatedBindings; - visitMatchesRecursively(ResultVisitor, &AggregatedBindings); + visitMatchesRecursively(ResultVisitor, AggregatedBindings); } void BoundNodesTree:: visitMatchesRecursively(Visitor* ResultVisitor, - BoundNodesMap* AggregatedBindings) { - Bindings.copyTo(AggregatedBindings); + const BoundNodesMap& AggregatedBindings) { + BoundNodesMap CombinedBindings(AggregatedBindings); + Bindings.copyTo(&CombinedBindings); if (RecursiveBindings.empty()) { - ResultVisitor->visitMatch(BoundNodes(*AggregatedBindings)); + ResultVisitor->visitMatch(BoundNodes(CombinedBindings)); } else { for (unsigned I = 0; I < RecursiveBindings.size(); ++I) { RecursiveBindings[I].visitMatchesRecursively(ResultVisitor, - AggregatedBindings); + CombinedBindings); } } } |