]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/clang/Analysis/Visitors/CFGRecStmtVisitor.h
Import Clang, at r72732.
[FreeBSD/FreeBSD.git] / include / clang / Analysis / Visitors / CFGRecStmtVisitor.h
1 //==- CFGRecStmtVisitor - Recursive visitor of CFG statements ---*- C++ --*-==//
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 // This file implements the template class CFGRecStmtVisitor, which extends
11 // CFGStmtVisitor by implementing a default recursive visit of all statements.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CLANG_ANALYSIS_CFG_REC_STMT_VISITOR_H
16 #define LLVM_CLANG_ANALYSIS_CFG_REC_STMT_VISITOR_H
17
18 #include "clang/Analysis/Visitors/CFGStmtVisitor.h"
19
20 namespace clang {
21 template <typename ImplClass>
22 class CFGRecStmtVisitor : public CFGStmtVisitor<ImplClass,void> {
23 public:  
24
25   void VisitStmt(Stmt* S) {
26     static_cast< ImplClass* >(this)->VisitChildren(S);
27   }
28       
29   // Defining operator() allows the visitor to be used as a C++ style functor.
30   void operator()(Stmt* S) { static_cast<ImplClass*>(this)->BlockStmt_Visit(S);}
31 };
32
33 } // end namespace clang
34
35 #endif