summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineBasicBlock.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-12-18 23:21:49 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-12-18 23:21:49 +0000
commit2e4b639790a166e55a0bf14fac54ca6ce583e459 (patch)
tree62896234e32dba62a5c3c214eca673a8cc519fb4 /include/llvm/CodeGen/MachineBasicBlock.h
parent1a3150098c137181576dc3e0960f8cd4abe9da1f (diff)
downloadllvm-2e4b639790a166e55a0bf14fac54ca6ce583e459.tar.gz
llvm-2e4b639790a166e55a0bf14fac54ca6ce583e459.tar.bz2
llvm-2e4b639790a166e55a0bf14fac54ca6ce583e459.tar.xz
Use bidirectional bundle flags to simplify important functions.
The bundle_iterator::operator++ function now doesn't need to dig out the basic block and check against end(). It can use the isBundledWithSucc() flag to find the last bundled instruction safely. Similarly, MachineInstr::isBundled() no longer needs to look at iterators etc. It only has to look at flags. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170473 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineBasicBlock.h')
-rw-r--r--include/llvm/CodeGen/MachineBasicBlock.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h
index 1225c8a99e..492a3ff49f 100644
--- a/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/include/llvm/CodeGen/MachineBasicBlock.h
@@ -146,11 +146,11 @@ public:
bundle_iterator(IterTy mii) : MII(mii) {}
bundle_iterator(Ty &mi) : MII(mi) {
- assert(!mi.isInsideBundle() &&
+ assert(!mi.isBundledWithPred() &&
"It's not legal to initialize bundle_iterator with a bundled MI");
}
bundle_iterator(Ty *mi) : MII(mi) {
- assert((!mi || !mi->isInsideBundle()) &&
+ assert((!mi || !mi->isBundledWithPred()) &&
"It's not legal to initialize bundle_iterator with a bundled MI");
}
// Template allows conversion from const to nonconst.
@@ -174,13 +174,13 @@ public:
// Increment and decrement operators...
bundle_iterator &operator--() { // predecrement - Back up
do --MII;
- while (MII->isInsideBundle());
+ while (MII->isBundledWithPred());
return *this;
}
bundle_iterator &operator++() { // preincrement - Advance
- IterTy E = MII->getParent()->instr_end();
- do ++MII;
- while (MII != E && MII->isInsideBundle());
+ while (MII->isBundledWithSucc())
+ ++MII;
+ ++MII;
return *this;
}
bundle_iterator operator--(int) { // postdecrement operators...