diff options
author | Andrew Trick <atrick@apple.com> | 2012-04-20 20:05:19 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-04-20 20:05:19 +0000 |
commit | d4786e221c679fced994993d9ee7228572d4b148 (patch) | |
tree | 3130dfb2122a784afc39a97888845c6b355d5553 /include/llvm/CodeGen/MachineBasicBlock.h | |
parent | 1b0b45bd82c6ac3f8c4114b6daec16aa006642ba (diff) | |
download | llvm-d4786e221c679fced994993d9ee7228572d4b148.tar.gz llvm-d4786e221c679fced994993d9ee7228572d4b148.tar.bz2 llvm-d4786e221c679fced994993d9ee7228572d4b148.tar.xz |
Allow converting MachineBasicBlock::iterator to const_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155225 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineBasicBlock.h')
-rw-r--r-- | include/llvm/CodeGen/MachineBasicBlock.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index ef9c0c2005..18df69ee92 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -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; } |