aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineBasicBlock.h
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-05-12 21:35:20 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-05-12 21:35:20 +0000
commitc07d8d8a26f63dfc54dbd0e1ff776763ec6443ad (patch)
tree338d7badaa568bd59a1d2c3b69dc6d6c465b44f8 /include/llvm/CodeGen/MachineBasicBlock.h
parent5f4d473d89010fb11d8c645377f172045892b681 (diff)
Add a Number field w/ accessor method, for function-level unique numbering
of MBBs. Add non-const MachineBasicBlock::getParent() accessor method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineBasicBlock.h')
-rw-r--r--include/llvm/CodeGen/MachineBasicBlock.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h
index 5faf2a21a9..f12c20008c 100644
--- a/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/include/llvm/CodeGen/MachineBasicBlock.h
@@ -63,9 +63,11 @@ public:
const BasicBlock *BB;
std::vector<MachineBasicBlock *> Predecessors;
std::vector<MachineBasicBlock *> Successors;
+ int Number;
public:
- MachineBasicBlock(const BasicBlock *bb = 0) : Prev(0), Next(0), BB(bb) {
+ MachineBasicBlock(const BasicBlock *bb = 0) : Prev(0), Next(0), BB(bb),
+ Number(-1) {
Insts.parent = this;
}
~MachineBasicBlock() {}
@@ -78,6 +80,7 @@ public:
/// getParent - Return the MachineFunction containing this basic block.
///
const MachineFunction *getParent() const;
+ MachineFunction *getParent();
typedef ilist<MachineInstr>::iterator iterator;
typedef ilist<MachineInstr>::const_iterator const_iterator;
@@ -158,6 +161,10 @@ public:
void dump() const;
void print(std::ostream &OS) const;
+ // MachineBasicBlocks are uniquely numbered at the function level
+ // (unless they're not in a MachineFunction yet)
+ int getNumber() const { return Number; }
+
private: // Methods used to maintain doubly linked list of blocks...
friend class ilist_traits<MachineBasicBlock>;