1 //===--- ParentMap.h - Mappings from Stmts to their Parents -----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the ParentMap class.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_PARENTMAP_H
15 #define LLVM_CLANG_PARENTMAP_H
24 ParentMap(Stmt
* ASTRoot
);
27 Stmt
*getParent(Stmt
*) const;
28 Stmt
*getParentIgnoreParens(Stmt
*) const;
30 const Stmt
*getParent(const Stmt
* S
) const {
31 return getParent(const_cast<Stmt
*>(S
));
34 const Stmt
*getParentIgnoreParens(const Stmt
*S
) const {
35 return getParentIgnoreParens(const_cast<Stmt
*>(S
));
38 bool hasParent(Stmt
* S
) const {
39 return getParent(S
) != 0;
42 bool isConsumedExpr(Expr
*E
) const;
44 bool isConsumedExpr(const Expr
*E
) const {
45 return isConsumedExpr(const_cast<Expr
*>(E
));
49 } // end clang namespace