Skip to content

Commit

Permalink
Add patchAPI/src/PatchFunction.C
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent f05b5ff commit d4f3857
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 9 additions & 0 deletions docs/patchAPI/developer/PatchCFG.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,23 @@ PatchCFG.h
.. cpp:function:: protected void removeBlock(PatchBlock *)
.. cpp:function:: protected void addBlock(PatchBlock *)
.. cpp:function:: protected void splitBlock(PatchBlock *first, PatchBlock *second)

The "first" block should already be in the function.

.. cpp:function:: protected void destroyPoints()

Destroy points for this block and then each containing function's context specific points for the
block.

.. cpp:function:: protected void destroyBlockPoints(PatchBlock *block)

Removes block points from ``points_`` and ``blockPoints_``.

.. cpp:function:: protected void invalidateBlocks()
.. cpp:function:: protected void getLoopsByNestingLevel(vector<PatchLoop*>& lbb, bool outerMostOnly)

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

.. cpp:function:: protected void createLoops()
.. cpp:function:: protected void createLoopHierarchy()
.. cpp:function:: protected void fillDominatorInfo()
Expand Down
8 changes: 0 additions & 8 deletions patchAPI/src/PatchFunction.C
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ bool PatchFunction::findInsnPoints(Point::Type type,
return false;
}

// remove block points from points_ and blockPoints_
void PatchFunction::destroyBlockPoints(PatchBlock *block)
{
PatchCallback *cb = obj()->cb();
Expand Down Expand Up @@ -519,7 +518,6 @@ PatchCallback *PatchFunction::cb() const {
return obj_->cb();
}

// the "first" block should already be in the function
void PatchFunction::splitBlock(PatchBlock *first, PatchBlock *second)
{
// 1) add second block to the function
Expand Down Expand Up @@ -818,9 +816,6 @@ PatchLoopTreeNode* PatchFunction::getLoopTree() {
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 PatchFunction::getLoopsByNestingLevel(vector<PatchLoop*>& lbb, bool outerMostOnly)
{
if (_loop_analyzed == false) {
Expand All @@ -839,15 +834,12 @@ void PatchFunction::getLoopsByNestingLevel(vector<PatchLoop*>& lbb, bool outerMo
return;
}


// get all the loops in this flow graph
bool PatchFunction::getLoops(vector<PatchLoop*>& lbb)
{
getLoopsByNestingLevel(lbb, false);
return true;
}

// get the outermost loops in this flow graph
bool PatchFunction::getOuterLoops(vector<PatchLoop*>& lbb)
{
getLoopsByNestingLevel(lbb, true);
Expand Down

0 comments on commit d4f3857

Please sign in to comment.