Allow converting MachineBasicBlock::iterator to const_iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155225 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Trick 2012-04-20 20:05:19 +00:00
parent 1b0b45bd82
commit d4786e221c

View File

@ -156,7 +156,10 @@ public:
assert((!mi || !mi->isInsideBundle()) &&
"It's not legal to initialize bundle_iterator with a bundled MI");
}
bundle_iterator(const bundle_iterator &I) : MII(I.MII) {}
// Template allows conversion from const to nonconst.
template<class OtherTy, class OtherIterTy>
bundle_iterator(const bundle_iterator<OtherTy, OtherIterTy> &I)
: MII(I.getInstrIterator()) {}
bundle_iterator() : MII(0) {}
Ty &operator*() const { return *MII; }