aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineBasicBlock.h
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-23 18:14:48 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-23 18:14:48 +0000
commit743d0a1f831f1d5a3141a6ca730558f40c35690a (patch)
treed2c1a5eefbfb5fc6922dab4d3dc29b3fb2f42242 /include/llvm/CodeGen/MachineBasicBlock.h
parentfbc39d50455f1895117fe9796294942759026540 (diff)
Refactor rewinding code for finding the first terminator of a basic
block into MachineBasicBlock::getFirstTerminator(). This also fixes a bug in the implementation of the above in both RegAllocLocal and InstrSched, where instructions where added after the terminator if the basic block's only instruction was a terminator (it shouldn't matter for RegAllocLocal since this case never occurs in practice). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11748 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineBasicBlock.h')
-rw-r--r--include/llvm/CodeGen/MachineBasicBlock.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h
index 44cab9e9e3..0fec6a2a2b 100644
--- a/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/include/llvm/CodeGen/MachineBasicBlock.h
@@ -95,6 +95,11 @@ public:
reverse_iterator rend () { return Insts.rend(); }
const_reverse_iterator rend () const { return Insts.rend(); }
+ /// getFirstTerminator - returns an iterator to the first terminator
+ /// instruction of this basic block. If a terminator does not exist,
+ /// it returns end()
+ iterator getFirstTerminator();
+
void push_back(MachineInstr *MI) { Insts.push_back(MI); }
template<typename IT>
void insert(iterator I, IT S, IT E) { Insts.insert(I, S, E); }