From 3190559282837ae3a806ce07174f2d1c37a28b5d Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Fri, 20 Apr 2012 20:05:19 +0000 Subject: [PATCH] Allow converting MachineBasicBlock::iterator to const_iterator. llvm-svn: 155225 --- llvm/include/llvm/CodeGen/MachineBasicBlock.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/CodeGen/MachineBasicBlock.h b/llvm/include/llvm/CodeGen/MachineBasicBlock.h index ef9c0c200584..18df69ee92be 100644 --- a/llvm/include/llvm/CodeGen/MachineBasicBlock.h +++ b/llvm/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 + bundle_iterator(const bundle_iterator &I) + : MII(I.getInstrIterator()) {} bundle_iterator() : MII(0) {} Ty &operator*() const { return *MII; }