mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
[MachineBasicBlock] Add getFirstNonDebugInstr to complement getLastNonDebugInstr
Use it in CodeGen where applicable. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240414 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -180,6 +180,14 @@ MachineBasicBlock::instr_iterator MachineBasicBlock::getFirstInstrTerminator() {
|
||||
return I;
|
||||
}
|
||||
|
||||
MachineBasicBlock::iterator MachineBasicBlock::getFirstNonDebugInstr() {
|
||||
// Skip over begin-of-block dbg_value instructions.
|
||||
iterator I = begin(), E = end();
|
||||
while (I != E && I->isDebugValue())
|
||||
++I;
|
||||
return I;
|
||||
}
|
||||
|
||||
MachineBasicBlock::iterator MachineBasicBlock::getLastNonDebugInstr() {
|
||||
// Skip over end-of-block dbg_value instructions.
|
||||
instr_iterator B = instr_begin(), I = instr_end();
|
||||
|
Reference in New Issue
Block a user