diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-31 04:56:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-31 04:56:33 +0000 |
commit | f20c1a497fe3922ac718429d65a5fe396890575e (patch) | |
tree | d0b6a54ac22fe125c6bcad9a0bdaf41af2f9fd6a /include/llvm/CodeGen/MachineBasicBlock.h | |
parent | 534bcfb270d25d2a29759d19981443fee7260e94 (diff) |
properly encapsulate the parent field of MBB and MI with get/set accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineBasicBlock.h')
-rw-r--r-- | include/llvm/CodeGen/MachineBasicBlock.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index eacf067feb..d2b1d5fc2d 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -33,17 +33,17 @@ protected: public: ilist_traits<MachineInstr>() : parent(0) { } - static MachineInstr* getPrev(MachineInstr* N) { return N->prev; } - static MachineInstr* getNext(MachineInstr* N) { return N->next; } + static MachineInstr* getPrev(MachineInstr* N) { return N->Prev; } + static MachineInstr* getNext(MachineInstr* N) { return N->Next; } static const MachineInstr* - getPrev(const MachineInstr* N) { return N->prev; } + getPrev(const MachineInstr* N) { return N->Prev; } static const MachineInstr* - getNext(const MachineInstr* N) { return N->next; } + getNext(const MachineInstr* N) { return N->Next; } - static void setPrev(MachineInstr* N, MachineInstr* prev) { N->prev = prev; } - static void setNext(MachineInstr* N, MachineInstr* next) { N->next = next; } + static void setPrev(MachineInstr* N, MachineInstr* prev) { N->Prev = prev; } + static void setNext(MachineInstr* N, MachineInstr* next) { N->Next = next; } static MachineInstr* createSentinel(); static void destroySentinel(MachineInstr *MI) { delete MI; } @@ -63,7 +63,9 @@ class MachineBasicBlock { MachineBasicBlock *Prev, *Next; const BasicBlock *BB; int Number; - MachineFunction *Parent; + MachineFunction *xParent; + + void setParent(MachineFunction *P) { xParent = P; } /// Predecessors/Successors - Keep track of the predecessor / successor /// basicblocks. @@ -79,10 +81,8 @@ class MachineBasicBlock { bool IsLandingPad; public: - explicit MachineBasicBlock(const BasicBlock *bb = 0) : Prev(0), Next(0), - BB(bb), Number(-1), - Parent(0), - IsLandingPad(false) { + explicit MachineBasicBlock(const BasicBlock *bb = 0) + : Prev(0), Next(0), BB(bb), Number(-1), xParent(0), IsLandingPad(false) { Insts.parent = this; } @@ -95,8 +95,8 @@ public: /// getParent - Return the MachineFunction containing this basic block. /// - const MachineFunction *getParent() const { return Parent; } - MachineFunction *getParent() { return Parent; } + const MachineFunction *getParent() const { return xParent; } + MachineFunction *getParent() { return xParent; } typedef ilist<MachineInstr>::iterator iterator; typedef ilist<MachineInstr>::const_iterator const_iterator; |