[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineBasicBlock.h
Alkis Evlogimenos
alkis at cs.uiuc.edu
Fri Feb 13 14:07:02 PST 2004
Changes in directory llvm/include/llvm/CodeGen:
MachineBasicBlock.h updated: 1.17 -> 1.18
---
Log message:
Mark MachineBasicBlock::operator[] deprecated.
---
Diffs of the changes: (+20 -10)
Index: llvm/include/llvm/CodeGen/MachineBasicBlock.h
diff -u llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.17 llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.18
--- llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.17 Thu Feb 12 22:40:15 2004
+++ llvm/include/llvm/CodeGen/MachineBasicBlock.h Fri Feb 13 14:05:56 2004
@@ -93,16 +93,11 @@
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(); }
@@ -140,6 +135,21 @@
void setPrev(MachineBasicBlock *P) { Prev = P; }
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
More information about the llvm-commits
mailing list