OpenASIP
2.0
|
#include <Reversible.hh>
Public Member Functions | |
virtual bool | operator() ()=0 |
virtual void | undo () |
virtual | ~Reversible () |
void | deleteChildren (std::stack< Reversible * > &children) |
int | id () |
Reversible () | |
Protected Member Functions | |
bool | runPreChild (Reversible *preChild) |
bool | runPostChild (Reversible *preChild) |
bool | runChild (std::stack< Reversible * > &children, Reversible *child) |
bool | runChild (Reversible *child, bool pre) |
void | undoAndRemovePreChildren () |
void | undoAndRemovePostChildren () |
void | undoAndRemoveChildren (std::stack< Reversible * > &children) |
virtual void | undoOnlyMe () |
Protected Attributes | |
std::stack< Reversible * > | preChildren_ |
std::stack< Reversible * > | postChildren_ |
Private Attributes | |
int | id_ |
Static Private Attributes | |
static int | idCounter_ = 0 |
Definition at line 36 of file Reversible.hh.
|
virtual |
Delete the undo information. cannot revert after this
Definition at line 35 of file Reversible.cc.
References deleteChildren(), postChildren_, and preChildren_.
|
inline |
Definition at line 44 of file Reversible.hh.
void Reversible::deleteChildren | ( | std::stack< Reversible * > & | children | ) |
Delete children without reverting them. They cannot be reverted after this
Definition at line 42 of file Reversible.cc.
References assert.
Referenced by ~Reversible().
|
inline |
|
pure virtual |
This performs the operation. Returns true if success, false if fail.
Implemented in BFRemoveGuardFromSucc, BFUnscheduleFromBody, BF2ScheduleFront, BFRemoveGuard, BFMergeAndKeepUser, BFRemoveGuardsFromSuccs, BFPostpassBypass, BFPostpassLoopDRE, BFAssignToBody, BFConnectNodes, BFRemoveEdge, BFTryRemoveGuard, BFUpdateMoveOnBypass, BFPostpassBypasser, BFPostpassDRE, BFEarlyBypass, BFEarlyGuardBypass, BFShareOperandLate, BFScheduleBU, BFScheduleExact, BFSchedule, BFUnscheduleMove, BFPushMoveUp2, BFRescheduleResultsClose, BFPushAntidepDown, BFRescheduleSuccessorsClose, BFLateBypass, BFPushMoveUp, BFScheduleTD, BFShareOperands, BFRenameLiveRange, BFShareOperandWithScheduled, BFDRELoop, BFRegCopy, BFRescheduleResultClose, BFPushAntidepsDown, BFPushDepsUp, BFKillNode, BFLateBypasses, BFRenameSource, BFShareOperand, BFInsertLiveRangeUse, BFClearLiveRangeUse, BFSwapOperands, BFDropPreShared, BFEarlyBypasser, BFShareOperandsLate, BFDREEarly, BFDRELate, BFSchedulePreLoopShared, BFLateBypassGuard, and BFRemoveLoopChecksAndJump.
|
protected |
Tries to run another Reversible and takes ownership of it.
if | pre is true, make it a pre-child, if pre is false, make it a post-child. |
Definition at line 151 of file Reversible.cc.
References runPostChild(), and runPreChild().
|
protected |
Tries to run another Reversible and takes ownership of it.
If the running succeeds, makes it a child. If the running fails, deletes it.
Definition at line 109 of file Reversible.cc.
Referenced by runPostChild(), runPreChild(), and BFMergeAndKeepUser::updateEdges().
|
protected |
Tries to run another Reversible (after running this).
If the running succeeds, makes it a post-child. If the running fails, deletes it.
Definition at line 139 of file Reversible.cc.
References postChildren_, and runChild().
Referenced by BFRegCopy::createAntidepsForReg(), BFEarlyBypass::operator()(), BFShareOperandsLate::operator()(), BFTryRemoveGuard::operator()(), BFLateBypasses::operator()(), BFPostpassBypass::operator()(), BFPushAntidepsDown::operator()(), BFRemoveGuardsFromSuccs::operator()(), BFRescheduleResultClose::operator()(), BFMergeAndKeepUser::operator()(), BFScheduleTD::operator()(), BFLateBypass::operator()(), BFPushMoveUp2::operator()(), BFScheduleExact::operator()(), BFScheduleBU::operator()(), BFRemoveGuardFromSucc::operator()(), BFShareOperandLate::operator()(), runChild(), BFRegCopyAfter::splitMove(), BFRegCopyBefore::splitMove(), and BFPostpassBypasser::tryBypassNode().
|
protected |
Tries to run another Reversible (before running this).
If the running succeeds, makes it a pre-child. If the running fails, deletes it.
Definition at line 127 of file Reversible.cc.
References preChildren_, and runChild().
Referenced by BF2ScheduleFront::getMoveNodeFromFrontBU(), BFEarlyBypass::operator()(), BFDropPreShared::operator()(), BFEarlyBypasser::operator()(), BFLateBypasses::operator()(), BFRenameSource::operator()(), BFPostpassBypass::operator()(), BFPushDepsUp::operator()(), BFRescheduleResultClose::operator()(), BFMergeAndKeepUser::operator()(), BFShareOperands::operator()(), BFScheduleTD::operator()(), BFPushMoveUp::operator()(), BFRescheduleSuccessorsClose::operator()(), BFRescheduleResultsClose::operator()(), BFRemoveGuard::operator()(), BFScheduleBU::operator()(), BFScheduleExact::operator()(), BFRemoveGuardFromSucc::operator()(), runChild(), BF2ScheduleFront::scheduleMove(), and BF2ScheduleFront::tryToScheduleMoveOuter().
|
virtual |
Undoes this and all children.
Definition at line 69 of file Reversible.cc.
References undoAndRemovePostChildren(), undoAndRemovePreChildren(), and undoOnlyMe().
Referenced by BFEarlyBypass::operator()(), BFPostpassBypass::operator()(), BFRemoveGuardsFromSuccs::operator()(), BFRescheduleResultClose::operator()(), BFLateBypass::operator()(), BFPushMoveUp2::operator()(), BFScheduleBU::operator()(), BFScheduleExact::operator()(), BFRemoveGuardFromSucc::operator()(), BF2Scheduler::revertTopOpt(), BF2ScheduleFront::scheduleFrontFromMove(), undoAndRemoveChildren(), BF2Scheduler::unschedule(), and BFMergeAndKeepUser::updateEdges().
|
protected |
Undoes one stack of children.
Definition at line 55 of file Reversible.cc.
References assert, and undo().
Referenced by BFPushMoveUp::operator()(), undoAndRemovePostChildren(), undoAndRemovePreChildren(), and BFRescheduleMove::undoOnlyMe().
|
protected |
Recursively calls undo for all children that were performed after this. So these are undoed before this is undoed
Definition at line 89 of file Reversible.cc.
References postChildren_, and undoAndRemoveChildren().
Referenced by BFRegCopyAfter::splitMove(), and undo().
|
protected |
Recursively calls undo for all children that were performed before this. So these are undoed after this is undoed
Definition at line 80 of file Reversible.cc.
References preChildren_, and undoAndRemoveChildren().
Referenced by BFLateBypasses::operator()(), BFPostpassBypass::operator()(), BFPushDepsUp::operator()(), BFScheduleTD::operator()(), BFScheduleBU::operator()(), BFScheduleExact::operator()(), and undo().
|
protectedvirtual |
Undoes the operations done by this class but not children. This method should be overloaded by most derived classes.
Reimplemented in BFRenameLiveRange, BFRemoveGuardFromSucc, BF2ScheduleFront, BFRemoveGuard, BFUnscheduleFromBody, BFMergeAndKeepUser, BFUpdateMoveOnBypass, BFPostpassBypass, BFPostpassLoopDRE, BFAssignToBody, BFConnectNodes, BFRemoveEdge, BFEarlyBypass, BFEarlyGuardBypass, BFShareOperandLate, BFScheduleBU, BFScheduleExact, BFUnscheduleMove, BFShareOperands, BFShareOperandWithScheduled, BFLateBypass, BFScheduleTD, BFRegCopy, BFRescheduleMove, BFDRELoop, BFShareOperand, BFSwapOperands, BFKillNode, BFInsertLiveRangeUse, BFScheduleMove, BFClearLiveRangeUse, BFShareOperandsLate, BFDropPreShared, BFSchedulePreLoopShared, BFLateBypassGuard, and BFRemoveLoopChecksAndJump.
Definition at line 98 of file Reversible.cc.
Referenced by undo().
|
private |
Definition at line 61 of file Reversible.hh.
Referenced by id().
|
staticprivate |
Definition at line 62 of file Reversible.hh.
|
protected |
Definition at line 58 of file Reversible.hh.
Referenced by BFLateBypassGuard::operator()(), BFPostpassBypasser::operator()(), BFPushAntidepsDown::operator()(), BFRemoveGuardsFromSuccs::operator()(), BFLateBypass::operator()(), runPostChild(), undoAndRemovePostChildren(), and ~Reversible().
|
protected |
Definition at line 57 of file Reversible.hh.
Referenced by BFPushDepsUp::operator()(), BFPushMoveUp::operator()(), BFScheduleBU::operator()(), runPreChild(), undoAndRemovePreChildren(), and ~Reversible().