Skip to content

Commit

Permalink
Add parseAPI/src/LoopAnalyzer.C
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent b6e8827 commit d1f5fb8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
21 changes: 21 additions & 0 deletions docs/parseAPI/developer/LoopAnalyzer.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,24 @@ LoopAnalyzer.h
Creates the tree of loops/callees for this flow graph.

.. cpp:function:: LoopAnalyzer (const Function *f)

.. cpp:member:: private const Function *func
.. cpp:member:: private std::map<Block*, set<Block*> > loop_tree
.. cpp:member:: private std::map<Block*, Loop*> loops
.. cpp:member:: private std::map<Block*, Block*> header
.. cpp:member:: private std::map<Block*, int> DFSP_pos
.. cpp:member:: private std::set<Block*> visited
.. cpp:function:: private Block* WMZC_DFS(Block* b0, int pos)
.. cpp:function:: private void WMZC_TagHead(Block* b, Block* h)
.. cpp:function:: private void FillMoreBackEdges(Loop *loop)
.. cpp:function:: private void dfsCreateLoopHierarchy(LoopTreeNode * parent, vector<Loop *> &loops, std::string level)
.. cpp:function:: private static void findBBForBackEdge(Edge*, std::set<Block*>&)
.. cpp:function:: private bool dfsInsertCalleeIntoLoopHierarchy(LoopTreeNode *node, Function *func, unsigned long addr)

Try to insert func into the appropriate spot in the loop tree based on
address ranges. if succesful return true, return false otherwise.

.. cpp:function:: private void insertCalleeIntoLoopHierarchy(Function * func, unsigned long addr)
.. cpp:function:: private void createLoops(Block* cur)

Recursively build the basic blocks in a loop and the contained loops in a loop
6 changes: 0 additions & 6 deletions parseAPI/src/LoopAnalyzer.C
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
using namespace Dyninst;
using namespace Dyninst::ParseAPI;

// constructor of the class. It creates the CFG and
LoopAnalyzer::LoopAnalyzer(const Function *f)
: func(f)
{
Expand Down Expand Up @@ -143,9 +142,6 @@ void LoopAnalyzer::createLoopHierarchy()
}
}


// try to insert func into the appropriate spot in the loop tree based on
// address ranges. if succesful return true, return false otherwise.
bool LoopAnalyzer::dfsInsertCalleeIntoLoopHierarchy(LoopTreeNode *node,
Function *callee,
unsigned long addr)
Expand Down Expand Up @@ -299,8 +295,6 @@ void LoopAnalyzer::WMZC_TagHead(Block* b, Block* h) {
header[cur1] = cur2;
}

// Recursively build the basic blocks in a loop
// and the contained loops in a loop
void LoopAnalyzer::createLoops(Block* cur) {
auto curLoop = loops[cur];
if(curLoop == NULL) return;
Expand Down

0 comments on commit d1f5fb8

Please sign in to comment.