diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-02-13 20:05:56 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-02-13 20:05:56 +0000 |
commit | 903b22cd51d82ba1c1c5ee5d37b7eb7911c755ee (patch) | |
tree | c6e8933611e7e61cb3b149433b8922acb5779a1c /include/llvm/CodeGen/MachineBasicBlock.h | |
parent | bccab5ed5e192e163773f992c34a25050e9f6592 (diff) |
Mark MachineBasicBlock::operator[] deprecated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11392 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineBasicBlock.h')
-rw-r--r-- | include/llvm/CodeGen/MachineBasicBlock.h | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index 2ab1624375..a0b7f26f20 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -93,16 +93,11 @@ public: unsigned size() const { return Insts.size(); } bool empty() const { return Insts.empty(); } - const MachineInstr& operator[](unsigned i) const { - const_iterator it = Insts.begin(); - std::advance(it, i); - return *it; - } - MachineInstr& operator[](unsigned i) { - iterator it = Insts.begin(); - std::advance(it, i); - return *it; - } + // This is a really inefficient way of accessing a basic + // block. These methods will be removed when all of their uses are + // eliminated. + inline const MachineInstr& operator[](unsigned i) const DEPRECATED; + inline MachineInstr& operator[](unsigned i) DEPRECATED; MachineInstr& front() { return Insts.front(); } MachineInstr& back() { return Insts.back(); } @@ -141,6 +136,21 @@ private: // Methods used to maintain doubly linked list of blocks... void setNext(MachineBasicBlock *N) { Next = N; } }; +const MachineInstr& MachineBasicBlock::operator[](unsigned i) const +{ + const_iterator it = Insts.begin(); + std::advance(it, i); + return *it; +} + +MachineInstr& MachineBasicBlock::operator[](unsigned i) +{ + iterator it = Insts.begin(); + std::advance(it, i); + return *it; +} + + } // End llvm namespace #endif |