Allow converting MachineBasicBlock::iterator to const_iterator.

llvm-svn: 155225
This commit is contained in:
Andrew Trick 2012-04-20 20:05:19 +00:00
parent 5b58af0381
commit 3190559282
1 changed files with 4 additions and 1 deletions

View File

@ -156,7 +156,10 @@ public:
assert((!mi || !mi->isInsideBundle()) && assert((!mi || !mi->isInsideBundle()) &&
"It's not legal to initialize bundle_iterator with a bundled MI"); "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) {} bundle_iterator() : MII(0) {}
Ty &operator*() const { return *MII; } Ty &operator*() const { return *MII; }