summaryrefslogtreecommitdiffstats
path: root/lib/AST/ParentMap.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-05-11 19:49:27 +0000
committerTed Kremenek <kremenek@apple.com>2009-05-11 19:49:27 +0000
commitb1b9f680f5fc65230de877baccae50820a969a94 (patch)
tree50a3bbff6d519f0b6c8ac9782692bca75f6633c6 /lib/AST/ParentMap.cpp
parentd0f8a8d17082266c1e774ca07d58bcd4811b2681 (diff)
Add ParentMap:getParentIgnoreParens().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ParentMap.cpp')
-rw-r--r--lib/AST/ParentMap.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/AST/ParentMap.cpp b/lib/AST/ParentMap.cpp
index 939e6f9be5..9d87daa0bf 100644
--- a/lib/AST/ParentMap.cpp
+++ b/lib/AST/ParentMap.cpp
@@ -46,6 +46,11 @@ Stmt* ParentMap::getParent(Stmt* S) const {
return I == M->end() ? 0 : I->second;
}
+Stmt *ParentMap::getParentIgnoreParens(Stmt *S) const {
+ do { S = getParent(S); } while (S && isa<ParenExpr>(S));
+ return S;
+}
+
bool ParentMap::isConsumedExpr(Expr* E) const {
Stmt *P = getParent(E);
Stmt *DirectChild = E;