zcov: / include/clang/AST/DeclVisitor.h


Files: 1 Branches Taken: 90.2% 46 / 51
Generated: 2010-02-10 01:31 Branches Executed: 100.0% 51 / 51
Line Coverage: 80.0% 4 / 5


Programs: 13 Runs 21005


       1                 : //===--- DeclVisitor.h - Visitor for Decl subclasses ------------*- 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 defines the DeclVisitor interface.
      11                 : //
      12                 : //===----------------------------------------------------------------------===//
      13                 : #ifndef LLVM_CLANG_AST_DECLVISITOR_H
      14                 : #define LLVM_CLANG_AST_DECLVISITOR_H
      15                 : 
      16                 : #include "clang/AST/Decl.h"
      17                 : #include "clang/AST/DeclObjC.h"
      18                 : #include "clang/AST/DeclCXX.h"
      19                 : #include "clang/AST/DeclTemplate.h"
      20                 : 
      21                 : namespace clang {
      22                 : 
      23                 : #define DISPATCH(NAME, CLASS) \
      24                 :   return static_cast<ImplClass*>(this)-> Visit##NAME(static_cast<CLASS*>(D))
      25                 : 
      26                 : /// \brief A simple visitor class that helps create declaration visitors.
      27                 : template<typename ImplClass, typename RetTy=void>
      28            19851: class DeclVisitor {
      29                 : public:
      30            13590:   RetTy Visit(Decl *D) {
                        0: branch 1 not taken
                      147: branch 2 taken
                       87: branch 3 taken
                        5: branch 4 taken
                        2: branch 5 taken
                      613: branch 6 taken
                        4: branch 7 taken
                      386: branch 8 taken
                       74: branch 9 taken
                     3054: branch 10 taken
                       38: branch 11 taken
                        4: branch 12 taken
                      155: branch 13 taken
                       29: branch 14 taken
                       12: branch 15 taken
                     1354: branch 16 taken
                     2248: branch 17 taken
                     1645: branch 18 taken
                      777: branch 19 taken
                      140: branch 20 taken
                      445: branch 21 taken
                       28: branch 22 taken
                        6: branch 23 taken
                     1009: branch 24 taken
                        6: branch 25 taken
                      260: branch 26 taken
                       45: branch 27 taken
                        0: branch 28 not taken
                       60: branch 29 taken
                      126: branch 30 taken
                       45: branch 31 taken
                        7: branch 32 taken
                        4: branch 33 taken
                      210: branch 34 taken
                        0: branch 35 not taken
                       99: branch 36 taken
                       91: branch 37 taken
                      238: branch 38 taken
                        2: branch 39 taken
                        9: branch 40 taken
                       16: branch 41 taken
                        1: branch 42 taken
                        0: branch 43 not taken
                        6: branch 44 taken
                        3: branch 45 taken
                       32: branch 46 taken
                        5: branch 47 taken
                       17: branch 48 taken
                        0: branch 49 not taken
                       42: branch 50 taken
                        4: branch 51 taken
      31            13590:     switch (D->getKind()) {
      32                0:       default: assert(false && "Decl that isn't part of DeclNodes.def!");
      33                 : #define DECL(Derived, Base) \
      34                 :       case Decl::Derived: DISPATCH(Derived##Decl, Derived##Decl);
      35                 : #define ABSTRACT_DECL(Derived, Base)
      36                 : #include "clang/AST/DeclNodes.def"
      37                 :     }
      38                 :   }
      39                 : 
      40                 :   // If the implementation chooses not to implement a certain visit
      41                 :   // method, fall back to the parent.
      42                 : #define DECL(Derived, Base)                                             \
      43                 :   RetTy Visit##Derived##Decl(Derived##Decl *D) { DISPATCH(Base, Base); }
      44                 : #define ABSTRACT_DECL(Derived, Base) DECL(Derived, Base)
      45                 : #include "clang/AST/DeclNodes.def"
      46                 : 
      47                1:   RetTy VisitDecl(Decl *D) { return RetTy(); }
      48                 : };
      49                 : 
      50                 : #undef DISPATCH
      51                 : 
      52                 : }  // end namespace clang
      53                 : 
      54                 : #endif // LLVM_CLANG_AST_DECLVISITOR_H

Generated: 2010-02-10 01:31 by zcov