diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-01-09 01:02:19 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-01-09 01:02:19 +0000 |
commit | d700a2f9c54e3312d28c132663bf60f81662b7f7 (patch) | |
tree | cd991ce98b65a3466b1e24ba6f8464d670021236 /include/llvm/CodeGen/MachineInstrBundle.h | |
parent | c3d6de2fe52dbdbf41b1dfebb1430656a16b254b (diff) | |
download | external_llvm-d700a2f9c54e3312d28c132663bf60f81662b7f7.zip external_llvm-d700a2f9c54e3312d28c132663bf60f81662b7f7.tar.gz external_llvm-d700a2f9c54e3312d28c132663bf60f81662b7f7.tar.bz2 |
Add a getBundleEnd() function to go with the existing getBundleStart().
This is easier implemented now that bundle flags are symmetric.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171927 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineInstrBundle.h')
-rw-r--r-- | include/llvm/CodeGen/MachineInstrBundle.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/MachineInstrBundle.h b/include/llvm/CodeGen/MachineInstrBundle.h index 3c60ad1..9519edb 100644 --- a/include/llvm/CodeGen/MachineInstrBundle.h +++ b/include/llvm/CodeGen/MachineInstrBundle.h @@ -45,18 +45,36 @@ bool finalizeBundles(MachineFunction &MF); /// inline MachineInstr *getBundleStart(MachineInstr *MI) { MachineBasicBlock::instr_iterator I = MI; - while (I->isInsideBundle()) + while (I->isBundledWithPred()) --I; return I; } inline const MachineInstr *getBundleStart(const MachineInstr *MI) { MachineBasicBlock::const_instr_iterator I = MI; - while (I->isInsideBundle()) + while (I->isBundledWithPred()) --I; return I; } +/// Return an iterator pointing beyond the bundle containing MI. +inline MachineBasicBlock::instr_iterator +getBundleEnd(MachineInstr *MI) { + MachineBasicBlock::instr_iterator I = MI; + while (I->isBundledWithSucc()) + ++I; + return ++I; +} + +/// Return an iterator pointing beyond the bundle containing MI. +inline MachineBasicBlock::const_instr_iterator +getBundleEnd(const MachineInstr *MI) { + MachineBasicBlock::const_instr_iterator I = MI; + while (I->isBundledWithSucc()) + ++I; + return ++I; +} + //===----------------------------------------------------------------------===// // MachineOperand iterator // |