From 0829da11d70b68b3afd1c6a1b8defa7763acc4a7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 31 Jul 2004 09:59:04 +0000 Subject: [PATCH] Expose some helpful methods llvm-svn: 15366 --- include/llvm/CodeGen/MachineBasicBlock.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index 93713685ba9..9d4ede6de1f 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -159,6 +159,7 @@ public: iterator getFirstTerminator(); void pop_front() { Insts.pop_front(); } + void pop_back() { Insts.pop_back(); } void push_back(MachineInstr *MI) { Insts.push_back(MI); } template void insert(iterator I, IT S, IT E) { Insts.insert(I, S, E); } @@ -171,6 +172,13 @@ public: iterator erase(iterator I, iterator E) { return Insts.erase(I, E); } MachineInstr *remove(MachineInstr *I) { return Insts.remove(I); } void clear() { Insts.clear(); } + + /// splice - Take a block of instructions from MBB 'Other' in the range [From, + /// To), and insert them into this MBB right before 'where'. + void splice(iterator where, MachineBasicBlock *Other, iterator From, + iterator To) { + Insts.splice(where, Other->Insts, From, To); + } // Debugging methods. void dump() const;