From d2176835fc6e497a6c3e19b4630745c3911bde2c Mon Sep 17 00:00:00 2001
From: Tuowen Zhao <ztuowen@gmail.com>
Date: Sun, 2 Oct 2016 14:10:10 -0600
Subject: fixes

---
 src/ast/node.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'src/ast')

diff --git a/src/ast/node.cpp b/src/ast/node.cpp
index dc0a913..c8a3c08 100644
--- a/src/ast/node.cpp
+++ b/src/ast/node.cpp
@@ -356,5 +356,11 @@ void chillAST_Node::gatherScalarVarDecls(vector<chillAST_VarDecl *> &decls) {
   }
 }
 
-
+chillAST_Node* chillAST_Node::findContainingStmt() {
+  chillAST_Node* p = getParent();
+  if (p->isCompoundStmt()) return this;
+  if (p->isForStmt()) return this;
+  if (p->isIfStmt()) return this;
+  return p->findContainingStmt();
+}
 
-- 
cgit v1.2.3-70-g09d2