diff options
| author | Brian Gaeke <gaeke@uiuc.edu> | 2004-05-12 21:35:20 +0000 |
|---|---|---|
| committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-05-12 21:35:20 +0000 |
| commit | 00db6be8794e9d1c37e0419f4667347d3829b8ed (patch) | |
| tree | 0c2c194bcdc8d7d28bcb85667566a4f25605bdcf /llvm | |
| parent | c9ebda0fcd5b82b7e4dd24c94e26c538343b5867 (diff) | |
| download | bcm5719-llvm-00db6be8794e9d1c37e0419f4667347d3829b8ed.tar.gz bcm5719-llvm-00db6be8794e9d1c37e0419f4667347d3829b8ed.zip | |
Add a Number field w/ accessor method, for function-level unique numbering
of MBBs.
Add non-const MachineBasicBlock::getParent() accessor method.
llvm-svn: 13512
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/CodeGen/MachineBasicBlock.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineBasicBlock.h b/llvm/include/llvm/CodeGen/MachineBasicBlock.h index 5faf2a21a97..f12c20008c9 100644 --- a/llvm/include/llvm/CodeGen/MachineBasicBlock.h +++ b/llvm/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>; |

