summaryrefslogtreecommitdiff
path: root/src/ir_rose_utils.cc
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2016-09-21 22:35:47 -0600
committerTuowen Zhao <ztuowen@gmail.com>2016-09-21 22:35:47 -0600
commitab016596602a4c6bdc27adf01c308b325af221f0 (patch)
tree4e86bfcf1f38fb00cc58082d540dc3570e0f126b /src/ir_rose_utils.cc
parent6983c09937baac3ffb7d3a45c3c5009c0eba7e6c (diff)
downloadchill-ab016596602a4c6bdc27adf01c308b325af221f0.tar.gz
chill-ab016596602a4c6bdc27adf01c308b325af221f0.tar.bz2
chill-ab016596602a4c6bdc27adf01c308b325af221f0.zip
something that only builds ...
Diffstat (limited to 'src/ir_rose_utils.cc')
-rw-r--r--src/ir_rose_utils.cc62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/ir_rose_utils.cc b/src/ir_rose_utils.cc
deleted file mode 100644
index 1329031..0000000
--- a/src/ir_rose_utils.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-/*****************************************************************************
- Copyright (C) 2008 University of Southern California
- Copyright (C) 2009 University of Utah
- All Rights Reserved.
-
- Purpose:
- ROSE interface utilities.
-
- Notes:
-
- Update history:
- 01/2006 created by Chun Chen
-*****************************************************************************/
-
-#include "ir_rose_utils.hh"
-
-
-
-std::vector<SgForStatement *> find_loops(SgNode *tnl) {
- std::vector<SgForStatement *> result;
-
- SgStatementPtrList& blockStatements = isSgBasicBlock(tnl)->get_statements();
- for(SgStatementPtrList::const_iterator j = blockStatements.begin(); j != blockStatements.end(); j++)
- if(isSgForStatement(*j))
- result.push_back(isSgForStatement(*j));
-
- return result;
-}
-
-std::vector<SgForStatement *> find_deepest_loops(SgStatementPtrList& tnl) {
-
- std::vector<SgForStatement *> loops;
-
- for(SgStatementPtrList::const_iterator j = tnl.begin(); j != tnl.end(); j++)
- {
- std::vector<SgForStatement *> t = find_deepest_loops(isSgNode(*j));
- if (t.size() > loops.size())
- loops = t;
- }
-
- return loops;
-}
-
-std::vector<SgForStatement *> find_deepest_loops(SgNode *tn) {
- if (isSgForStatement(tn)) {
- std::vector<SgForStatement *> loops;
-
- SgForStatement *tnf = static_cast<SgForStatement*>(tn);
- loops.insert(loops.end(), tnf);
- std::vector<SgForStatement*> t = find_deepest_loops(isSgNode(tnf->get_loop_body()));
- std::copy(t.begin(), t.end(), std::back_inserter(loops));
-
- return loops;
- }
- else if (isSgBasicBlock(tn)) {
- SgBasicBlock *tnb = static_cast<SgBasicBlock*>(tn);
- return find_deepest_loops(tnb->get_statements());
- }
- else
- return std::vector<SgForStatement *>();
-}
-