54 for (
int bbIndex = 0; bbIndex < nodeCount; ++bbIndex) {
88#ifdef DEBUG_CALLS_TO_JUMPS
90 <<
"### found call: " << originalCall.
toString()
93 <<
"### BB: " << bb.
toString() << std::endl;
109 std::shared_ptr<Move> returnAddressMove = NULL;
110 std::shared_ptr<Move> jumpToFunction;
114 if (returnLocation != NULL) {
118 returnAddressMove = std::make_shared<Move>(
125 jumpToFunction = std::make_shared<Move>(
131 if (returnLocation != NULL) {
135 returnAddressMove = std::make_shared<Move>(
143 jumpToFunction = std::make_shared<Move>(
150 jumpToFunction->addAnnotation(
153 if (returnAddressMove != NULL) {
156 raMoveInstr->
addMove(returnAddressMove);
160 irm.
replace(instr, *raMoveInstr);
165 jumpInstr->
addMove(jumpToFunction);
169 if (returnAddressMove == NULL && irm.
hasReference(instr))
170 irm.
replace(instr, *jumpInstr);
176#ifdef DEBUG_CALLS_TO_JUMPS
178 <<
"### removing " << instr.
toString() << std::endl;
#define assert(condition)
static std::ostream & logStream()
TTAProgram::BasicBlock & basicBlock()
Node & node(const int index) const
virtual void handleControlFlowGraph(ControlFlowGraph &cfg, const TTAMachine::Machine &targetMachine)
BasicBlockNode * fallThruSuccessor(const BasicBlockNode &bbn) const
TTAProgram::InstructionReferenceManager & instructionReferenceManager()
SpecialRegisterPort * returnAddressPort() const
virtual ControlUnit * controlUnit() const
static NullInstructionTemplate & instance()
TTAProgram::TerminalFUPort * createTerminalFUPort(const TCEString &opName, int operand)
virtual Instruction & firstInstruction() const
virtual std::string toString() const
virtual int instructionCount() const
virtual void remove(Instruction &ins)
virtual void insertBefore(const Instruction &pos, Instruction *ins)
virtual Instruction & instructionAtIndex(int index) const
void replace(Instruction &insA, Instruction &insB)
bool hasReference(Instruction &ins) const
InstructionReference createReference(Instruction &ins)
std::string toString() const
void addMove(std::shared_ptr< Move > move)
MoveGuard & guard() const
bool isUnconditional() const
std::string toString() const
Terminal & source() const
@ ANN_JUMP_FUNCTION_CALL
The JUMP in the annotated move is a function call and should be treated as such in the data dependenc...
virtual Terminal * copy() const =0
static UniversalMachine & instance()
TTAMachine::Bus & universalBus() const