diff options
Diffstat (limited to 'lib/AST/ParentMap.cpp')
-rw-r--r-- | lib/AST/ParentMap.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/AST/ParentMap.cpp b/lib/AST/ParentMap.cpp index eca351a..b7b2005 100644 --- a/lib/AST/ParentMap.cpp +++ b/lib/AST/ParentMap.cpp @@ -66,6 +66,15 @@ Stmt *ParentMap::getParentIgnoreParenCasts(Stmt *S) const { return S; } +Stmt *ParentMap::getOuterParenParent(Stmt *S) const { + Stmt *Paren = 0; + while (isa<ParenExpr>(S)) { + Paren = S; + S = getParent(S); + }; + return Paren; +} + bool ParentMap::isConsumedExpr(Expr* E) const { Stmt *P = getParent(E); Stmt *DirectChild = E; |