forked from OSchip/llvm-project
Mark MachineBasicBlock::operator[] deprecated.
llvm-svn: 11392
This commit is contained in:
parent
1aa50dfae5
commit
ef9d025ebe
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue