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


Files: 1 Branches Taken: 0.0% 0 / 0
Generated: 2010-02-10 01:31 Branches Executed: 0.0% 0 / 0
Line Coverage: 100.0% 6 / 6


Programs: 2 Runs 5794


       1                 : //===--- ParentMap.h - Mappings from Stmts to their Parents -----*- 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 ParentMap class.
      11                 : //
      12                 : //===----------------------------------------------------------------------===//
      13                 : 
      14                 : #ifndef LLVM_CLANG_PARENTMAP_H
      15                 : #define LLVM_CLANG_PARENTMAP_H
      16                 : 
      17                 : namespace clang {
      18                 : class Stmt;
      19                 : class Expr;
      20                 : 
      21                 : class ParentMap {
      22                 :   void* Impl;
      23                 : public:
      24                 :   ParentMap(Stmt* ASTRoot);
      25                 :   ~ParentMap();
      26                 : 
      27                 :   Stmt *getParent(Stmt*) const;
      28                 :   Stmt *getParentIgnoreParens(Stmt *) const;
      29                 : 
      30             6734:   const Stmt *getParent(const Stmt* S) const {
      31             6734:     return getParent(const_cast<Stmt*>(S));
      32                 :   }
      33                 : 
      34             4242:   const Stmt *getParentIgnoreParens(const Stmt *S) const {
      35             4242:     return getParentIgnoreParens(const_cast<Stmt*>(S));
      36                 :   }
      37                 : 
      38                 :   bool hasParent(Stmt* S) const {
      39                 :     return getParent(S) != 0;
      40                 :   }
      41                 : 
      42                 :   bool isConsumedExpr(Expr *E) const;
      43                 : 
      44             2432:   bool isConsumedExpr(const Expr *E) const {
      45             2432:     return isConsumedExpr(const_cast<Expr*>(E));
      46                 :   }
      47                 : };
      48                 : 
      49                 : } // end clang namespace
      50                 : #endif

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