summaryrefslogtreecommitdiff
path: root/ir_rose_utils.cc
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2016-09-17 03:22:53 +0000
committerTuowen Zhao <ztuowen@gmail.com>2016-09-17 03:22:53 +0000
commit75ff98e4d65862ff5b36b533b4f6e3ea71ede1d5 (patch)
tree498ac06b4cf78568b807fafd2619856afff69c28 /ir_rose_utils.cc
parent29efa7b1a0d089e02a70f73f348f11878955287c (diff)
downloadchill-75ff98e4d65862ff5b36b533b4f6e3ea71ede1d5.tar.gz
chill-75ff98e4d65862ff5b36b533b4f6e3ea71ede1d5.tar.bz2
chill-75ff98e4d65862ff5b36b533b4f6e3ea71ede1d5.zip
cmake build
Diffstat (limited to 'ir_rose_utils.cc')
-rw-r--r--ir_rose_utils.cc88
1 files changed, 0 insertions, 88 deletions
diff --git a/ir_rose_utils.cc b/ir_rose_utils.cc
deleted file mode 100644
index fbce2f1..0000000
--- a/ir_rose_utils.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-/*****************************************************************************
- Copyright (C) 2008 University of Southern California
- Copyright (C) 2009 University of Utah
- All Rights Reserved.
-
- Purpose:
- SUIF interface utilities.
-
- Notes:
-
- Update history:
- 01/2006 created by Chun Chen
-*****************************************************************************/
-
-//#include <suif1.h>
-//#include <useful.h>
-//#include <vector>
-//#include <algorithm>
-//#include <code_gen/CG_suifRepr.h>
-#include "ir_rose_utils.hh"
-
-
-
-std::vector<SgForStatement *> find_loops(SgNode *tnl) {
- std::vector<SgForStatement *> result;
-
- //tree_node_list_iter iter(tnl);
-
- /*while (!iter.is_empty()) {
- tree_node *tn = iter.step();
- if (tn->kind() == TREE_FOR)
- result.push_back(static_cast<tree_for *>(tn));
- }
- */
-
- 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 *>();
-}
-