Home | History | Annotate | Download | only in ASTMatchers
      1 //===--- ASTMatchersInternal.cpp - Structural query framework -------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is distributed under the University of Illinois Open Source
      6 // License. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 //
     10 //  Implements the base layer of the matcher framework.
     11 //
     12 //===----------------------------------------------------------------------===//
     13 
     14 #include "clang/ASTMatchers/ASTMatchers.h"
     15 #include "clang/ASTMatchers/ASTMatchersInternal.h"
     16 
     17 namespace clang {
     18 namespace ast_matchers {
     19 namespace internal {
     20 
     21 void BoundNodesTreeBuilder::visitMatches(Visitor *ResultVisitor) {
     22   if (Bindings.empty())
     23     Bindings.push_back(BoundNodesMap());
     24   for (unsigned i = 0, e = Bindings.size(); i != e; ++i) {
     25     ResultVisitor->visitMatch(BoundNodes(Bindings[i]));
     26   }
     27 }
     28 
     29 void BoundNodesTreeBuilder::addMatch(const BoundNodesTreeBuilder &Other) {
     30   for (unsigned i = 0, e = Other.Bindings.size(); i != e; ++i) {
     31     Bindings.push_back(Other.Bindings[i]);
     32   }
     33 }
     34 
     35 DynTypedMatcher::~DynTypedMatcher() {}
     36 
     37 DynTypedMatcher *DynTypedMatcher::tryBind(StringRef ID) const { return NULL; }
     38 
     39 } // end namespace internal
     40 } // end namespace ast_matchers
     41 } // end namespace clang
     42