diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-06-23 14:47:29 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-06-23 14:47:29 +0000 |
| commit | 6b568964ba92ea5b05860623e80da2a4db2bfac0 (patch) | |
| tree | 60f1e4aba303438f729c388ed625956521e5d3a8 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
| parent | 9c956b33d7ac69e0ef4346cfa426c64c9ab3b8e0 (diff) | |
[MachineBasicBlock] Add getFirstNonDebugInstr to complement getLastNonDebugInstr
Use it in CodeGen where applicable. No functionality change intended.
llvm-svn: 240414
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index cfdf5a6a6ed8..dc81a3f05daa 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -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(); |
