mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 06:32:09 +00:00
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
This commit is contained in:
parent
5f4d473d89
commit
c07d8d8a26
@ -63,9 +63,11 @@ public:
|
|||||||
const BasicBlock *BB;
|
const BasicBlock *BB;
|
||||||
std::vector<MachineBasicBlock *> Predecessors;
|
std::vector<MachineBasicBlock *> Predecessors;
|
||||||
std::vector<MachineBasicBlock *> Successors;
|
std::vector<MachineBasicBlock *> Successors;
|
||||||
|
int Number;
|
||||||
|
|
||||||
public:
|
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;
|
Insts.parent = this;
|
||||||
}
|
}
|
||||||
~MachineBasicBlock() {}
|
~MachineBasicBlock() {}
|
||||||
@ -78,6 +80,7 @@ public:
|
|||||||
/// getParent - Return the MachineFunction containing this basic block.
|
/// getParent - Return the MachineFunction containing this basic block.
|
||||||
///
|
///
|
||||||
const MachineFunction *getParent() const;
|
const MachineFunction *getParent() const;
|
||||||
|
MachineFunction *getParent();
|
||||||
|
|
||||||
typedef ilist<MachineInstr>::iterator iterator;
|
typedef ilist<MachineInstr>::iterator iterator;
|
||||||
typedef ilist<MachineInstr>::const_iterator const_iterator;
|
typedef ilist<MachineInstr>::const_iterator const_iterator;
|
||||||
@ -158,6 +161,10 @@ public:
|
|||||||
void dump() const;
|
void dump() const;
|
||||||
void print(std::ostream &OS) 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...
|
private: // Methods used to maintain doubly linked list of blocks...
|
||||||
friend class ilist_traits<MachineBasicBlock>;
|
friend class ilist_traits<MachineBasicBlock>;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user