aboutsummaryrefslogtreecommitdiff
path: root/lib/ASTMatchers/ASTMatchersInternal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ASTMatchers/ASTMatchersInternal.cpp')
-rw-r--r--lib/ASTMatchers/ASTMatchersInternal.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/ASTMatchers/ASTMatchersInternal.cpp b/lib/ASTMatchers/ASTMatchersInternal.cpp
index c864e31cb1..69c51905fe 100644
--- a/lib/ASTMatchers/ASTMatchersInternal.cpp
+++ b/lib/ASTMatchers/ASTMatchersInternal.cpp
@@ -21,8 +21,8 @@ namespace internal {
BoundNodesTree::BoundNodesTree() {}
BoundNodesTree::BoundNodesTree(
- const std::map<std::string, const clang::Decl*>& DeclBindings,
- const std::map<std::string, const clang::Stmt*>& StmtBindings,
+ const std::map<std::string, const Decl*>& DeclBindings,
+ const std::map<std::string, const Stmt*>& StmtBindings,
const std::vector<BoundNodesTree> RecursiveBindings)
: DeclBindings(DeclBindings), StmtBindings(StmtBindings),
RecursiveBindings(RecursiveBindings) {}
@@ -44,22 +44,22 @@ void BoundNodesTree::copyBindingsTo(
for (typename T::const_iterator I = Bindings.begin(),
E = Bindings.end();
I != E; ++I) {
- Builder->setBinding(*I);
+ Builder->setBinding(I->first, I->second);
}
}
void BoundNodesTree::visitMatches(Visitor* ResultVisitor) {
- std::map<std::string, const clang::Decl*> AggregatedDeclBindings;
- std::map<std::string, const clang::Stmt*> AggregatedStmtBindings;
+ std::map<std::string, const Decl*> AggregatedDeclBindings;
+ std::map<std::string, const Stmt*> AggregatedStmtBindings;
visitMatchesRecursively(ResultVisitor, AggregatedDeclBindings,
AggregatedStmtBindings);
}
void BoundNodesTree::
visitMatchesRecursively(Visitor* ResultVisitor,
- std::map<std::string, const clang::Decl*>
+ std::map<std::string, const Decl*>
AggregatedDeclBindings,
- std::map<std::string, const clang::Stmt*>
+ std::map<std::string, const Stmt*>
AggregatedStmtBindings) {
copy(DeclBindings.begin(), DeclBindings.end(),
inserter(AggregatedDeclBindings, AggregatedDeclBindings.begin()));
@@ -79,14 +79,14 @@ visitMatchesRecursively(Visitor* ResultVisitor,
BoundNodesTreeBuilder::BoundNodesTreeBuilder() {}
-void BoundNodesTreeBuilder::
-setBinding(const std::pair<const std::string, const clang::Decl*>& Binding) {
- DeclBindings.insert(Binding);
+void BoundNodesTreeBuilder::setBinding(const std::string &Id,
+ const Decl *Node) {
+ DeclBindings[Id] = Node;
}
-void BoundNodesTreeBuilder::
-setBinding(const std::pair<const std::string, const clang::Stmt*>& Binding) {
- StmtBindings.insert(Binding);
+void BoundNodesTreeBuilder::setBinding(const std::string &Id,
+ const Stmt *Node) {
+ StmtBindings[Id] = Node;
}
void BoundNodesTreeBuilder::addMatch(const BoundNodesTree& Bindings) {