mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-13 20:25:12 +00:00
[MachineBasicBlock] Use the const_cast(this) trick to reduce duplication
NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240413 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -171,16 +171,6 @@ MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminator() {
|
||||
return I;
|
||||
}
|
||||
|
||||
MachineBasicBlock::const_iterator
|
||||
MachineBasicBlock::getFirstTerminator() const {
|
||||
const_iterator B = begin(), E = end(), I = E;
|
||||
while (I != B && ((--I)->isTerminator() || I->isDebugValue()))
|
||||
; /*noop */
|
||||
while (I != E && !I->isTerminator())
|
||||
++I;
|
||||
return I;
|
||||
}
|
||||
|
||||
MachineBasicBlock::instr_iterator MachineBasicBlock::getFirstInstrTerminator() {
|
||||
instr_iterator B = instr_begin(), E = instr_end(), I = E;
|
||||
while (I != B && ((--I)->isTerminator() || I->isDebugValue()))
|
||||
@ -204,21 +194,6 @@ MachineBasicBlock::iterator MachineBasicBlock::getLastNonDebugInstr() {
|
||||
return end();
|
||||
}
|
||||
|
||||
MachineBasicBlock::const_iterator
|
||||
MachineBasicBlock::getLastNonDebugInstr() const {
|
||||
// Skip over end-of-block dbg_value instructions.
|
||||
const_instr_iterator B = instr_begin(), I = instr_end();
|
||||
while (I != B) {
|
||||
--I;
|
||||
// Return instruction that starts a bundle.
|
||||
if (I->isDebugValue() || I->isInsideBundle())
|
||||
continue;
|
||||
return I;
|
||||
}
|
||||
// The block is all debug values.
|
||||
return end();
|
||||
}
|
||||
|
||||
const MachineBasicBlock *MachineBasicBlock::getLandingPadSuccessor() const {
|
||||
// A block with a landing pad successor only has one other successor.
|
||||
if (succ_size() > 2)
|
||||
|
Reference in New Issue
Block a user