summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-26 15:41:13 +0000
committerChris Lattner <sabre@nondot.org>2004-10-26 15:41:13 +0000
commit3dfbb558b5e74554104710ed16807fe74ec220a3 (patch)
tree66610500051989ce49221325ca9827a5284f9fe2 /include/llvm/CodeGen
parent27f291600b04c382c390b16fdacd52b910b9164d (diff)
downloadllvm-3dfbb558b5e74554104710ed16807fe74ec220a3.tar.gz
llvm-3dfbb558b5e74554104710ed16807fe74ec220a3.tar.bz2
llvm-3dfbb558b5e74554104710ed16807fe74ec220a3.tar.xz
Remove the unused MachineBasicBlock2IndexFunctor class.
Move method bodies that depend on <algorithm> out of line to MachineBasicBlock.cpp. Patch contributed by Morten Ofstad! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17252 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r--include/llvm/CodeGen/MachineBasicBlock.h37
1 files changed, 5 insertions, 32 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h
index 578f2b6c60..62a6e80208 100644
--- a/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/include/llvm/CodeGen/MachineBasicBlock.h
@@ -128,30 +128,18 @@ public:
/// addSuccessor - Add succ as a successor of this MachineBasicBlock.
/// The Predecessors list of succ is automatically updated.
///
- void addSuccessor(MachineBasicBlock *succ) {
- Successors.push_back(succ);
- succ->addPredecessor(this);
- }
+ void addSuccessor(MachineBasicBlock *succ);
/// removeSuccessor - Remove successor from the successors list of this
/// MachineBasicBlock. The Predecessors list of succ is automatically updated.
///
- void removeSuccessor(MachineBasicBlock *succ) {
- succ->removePredecessor(this);
- succ_iterator I = std::find(Successors.begin(), Successors.end(), succ);
- assert(I != Successors.end() && "Not a current successor!");
- Successors.erase(I);
- }
+ void removeSuccessor(MachineBasicBlock *succ);
/// removeSuccessor - Remove specified successor from the successors list of
/// this MachineBasicBlock. The Predecessors list of succ is automatically
/// updated.
///
- void removeSuccessor(succ_iterator I) {
- assert(I != Successors.end() && "Not a current successor!");
- (*I)->removePredecessor(this);
- Successors.erase(I);
- }
+ void removeSuccessor(succ_iterator I);
/// getFirstTerminator - returns an iterator to the first terminator
/// instruction of this basic block. If a terminator does not exist,
@@ -204,31 +192,16 @@ private: // Methods used to maintain doubly linked list of blocks...
/// Don't do this unless you know what you're doing, because it doesn't
/// update pred's successors list. Use pred->addSuccessor instead.
///
- void addPredecessor (MachineBasicBlock *pred) {
- Predecessors.push_back (pred);
- }
+ void addPredecessor(MachineBasicBlock *pred);
/// removePredecessor - Remove pred as a predecessor of this
/// MachineBasicBlock. Don't do this unless you know what you're
/// doing, because it doesn't update pred's successors list. Use
/// pred->removeSuccessor instead.
///
- void removePredecessor (MachineBasicBlock *pred) {
- std::vector<MachineBasicBlock *>::iterator goner =
- std::find (Predecessors.begin(), Predecessors.end (), pred);
- Predecessors.erase (goner);
- }
+ void removePredecessor(MachineBasicBlock *pred);
};
-// This is useful when building DenseMaps keyed on MachineBasicBlocks
-struct MachineBasicBlock2IndexFunctor
- : std::unary_function<const MachineBasicBlock*, unsigned> {
- unsigned operator()(const MachineBasicBlock* MBB) const {
- assert(MBB->getNumber() != -1 &&
- "MachineBasicBlock does not belong to a MachineFunction");
- return MBB->getNumber();
- }
-};
//===--------------------------------------------------------------------===//