[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineBasicBlock.h
Brian Gaeke
gaeke at cs.uiuc.edu
Tue Apr 27 23:00:01 PDT 2004
Changes in directory llvm/include/llvm/CodeGen:
MachineBasicBlock.h updated: 1.25 -> 1.26
---
Log message:
Fix thinkos that Chris caught for me.
Make pred mutators private.
---
Diffs of the changes: (+4 -2)
Index: llvm/include/llvm/CodeGen/MachineBasicBlock.h
diff -u llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.25 llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.26
--- llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.25 Tue Apr 27 21:16:33 2004
+++ llvm/include/llvm/CodeGen/MachineBasicBlock.h Tue Apr 27 22:59:48 2004
@@ -119,10 +119,10 @@
/// The Predecessors list of succ is automatically updated.
///
void addSuccessor (MachineBasicBlock *succ) {
- Successors.push_back (succ);
assert (std::find (Successors.begin (), Successors.end (), succ)
== Successors.end ()
&& "Trying to addSuccessor a MBB which is already my successor");
+ Successors.push_back (succ);
succ->addPredecessor (this);
}
@@ -138,15 +138,16 @@
Successors.erase (goner);
}
+private:
/// addPredecessor - 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->addSuccessor instead.
///
void addPredecessor (MachineBasicBlock *pred) {
- Predecessors.push_back (pred);
assert(std::find (Predecessors.begin (), Predecessors.end (), pred)
== Predecessors.end ()
&& "Trying to addPredecessor a MBB which is already my predecessor");
+ Predecessors.push_back (pred);
}
/// removePredecessor - Remove pred as a predecessor of this
@@ -162,6 +163,7 @@
Predecessors.erase (goner);
}
+public:
/// getFirstTerminator - returns an iterator to the first terminator
/// instruction of this basic block. If a terminator does not exist,
/// it returns end()
More information about the llvm-commits
mailing list