unsigned WebAssemblyInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const { MachineBasicBlock::instr_iterator I = MBB.instr_end(); unsigned Count = 0; while (I != MBB.instr_begin()) { --I; if (I->isDebugValue()) continue; if (!I->isTerminator()) break; // Remove the branch. I->eraseFromParent(); I = MBB.instr_end(); ++Count; } return Count; }
unsigned WebAssemblyInstrInfo::removeBranch(MachineBasicBlock &MBB, int *BytesRemoved) const { assert(!BytesRemoved && "code size not handled"); MachineBasicBlock::instr_iterator I = MBB.instr_end(); unsigned Count = 0; while (I != MBB.instr_begin()) { --I; if (I->isDebugInstr()) continue; if (!I->isTerminator()) break; // Remove the branch. I->eraseFromParent(); I = MBB.instr_end(); ++Count; } return Count; }