Skip to content

Commit

Permalink
Add parseAPI/src/Function.C
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent 8fa5ca6 commit 29d99a0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
16 changes: 16 additions & 0 deletions docs/parseAPI/developer/CFG.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ CFG.h


.. cpp:function:: private void delayed_link_return(CodeObject * co, Block * retblk)

Adds return edges to the CFG for a particular retblk, based on callers to this function. Handles
case of return block that targets the entry block of a new function separately (ret to entry
happens if the function tampers with its stack and maybe if this function is a signal handler?)

.. cpp:function:: private void finalize()
.. cpp:member:: private bool _parsed
.. cpp:member:: private std::vector<FuncExtent *> _extents
Expand Down Expand Up @@ -143,13 +148,24 @@ CFG.h
NULL if the tree structure has not be calculated

.. cpp:function:: private void getLoopsByNestingLevel(std::vector<Loop*>& lbb, bool outerMostOnly) const

Returns the loop objects that exist in the control flow grap.

.. cpp:member:: private std::map<Address, JumpTableInstance> jumptables
.. cpp:member:: private mutable bool isDominatorInfoReady

Dominator and post-dominator info details

.. cpp:member:: private mutable bool isPostDominatorInfoReady
.. cpp:function:: private void fillDominatorInfo() const

Fills the dominator information of each basic block looking at the control flow edges.

It uses a fixed-point calculation to find the immediate dominator of the basic blocks and the set of
basic blocks that are immediately dominated by this one. Before calling this method all the
dominator information is going to give incorrect results. So first this function must be called to
process dominator related fields and methods.

.. cpp:function:: private void fillPostDominatorInfo() const

......
Expand Down
21 changes: 0 additions & 21 deletions parseAPI/src/Function.C
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ Function::blocks()
return blocklist(blocks_begin(), blocks_end());
}

// Get the current set of blocks,
// as a const operation
Function::const_blocklist
Function::blocks() const
{
Expand Down Expand Up @@ -395,12 +393,6 @@ Function::blocks_int()
return blocklist(blocks_begin(), blocks_end());
}

/* Adds return edges to the CFG for a particular retblk, based
* on callers to this function. Handles case of return block
* that targets the entry block of a new function separately
* (ret to entry happens if the function tampers with its stack
* and maybe if this function is a signal handler?)
*/
void
Function::delayed_link_return(CodeObject * o, Block * retblk)
{
Expand Down Expand Up @@ -719,9 +711,6 @@ LoopTreeNode* Function::getLoopTree() const{
return _loop_root;
}

// this methods returns the loop objects that exist in the control flow
// grap. It returns a set. And if there are no loops, then it returns the empty
// set. not NULL.
void Function::getLoopsByNestingLevel(vector<Loop*>& lbb,
bool outerMostOnly) const
{
Expand All @@ -744,7 +733,6 @@ void Function::getLoopsByNestingLevel(vector<Loop*>& lbb,
}


// get all the loops in this flow graph
bool
Function::getLoops(vector<Loop*>& lbb) const
{
Expand All @@ -753,7 +741,6 @@ Function::getLoops(vector<Loop*>& lbb) const
return true;
}

// get the outermost loops in this flow graph
bool
Function::getOuterLoops(vector<Loop*>& lbb) const
{
Expand All @@ -768,14 +755,6 @@ Loop *Function::findLoop(const char *name) const
return getLoopTree()->findLoop(name);
}


//this method fill the dominator information of each basic block
//looking at the control flow edges. It uses a fixed point calculation
//to find the immediate dominator of the basic blocks and the set of
//basic blocks that are immediately dominated by this one.
//Before calling this method all the dominator information
//is going to give incorrect results. So first this function must
//be called to process dominator related fields and methods.
void Function::fillDominatorInfo() const
{
boost::lock_guard<const Function> g(*this);
Expand Down

0 comments on commit 29d99a0

Please sign in to comment.