[LLVMdev] subtle problem with inst_iterator

Chris Lattner sabre at nondot.org
Tue Apr 27 10:17:01 PDT 2004


On Tue, 27 Apr 2004, Vladimir Prus wrote:
> > Yeah, fishy huh?  :)
>
> Yea, a bit. I've decided that before changing that I'd better find other
> problems, if any, so I run inst_iterator via checks provided by
> Boost.Iterators.
>
> First problem is that inst_iterator (and actually InstIterator class template)
> is not Assignable, because it has a reference data member, while standard
> requires all iterators to be assignable.

Ok.

> Second InstIterator is not DefaultConstructile, which is required from
> Forwarditerator.

Ok, makes sense.

> Also, I get error because InstIterator::difference_type is not signed integer
> type (its defined as unsigned), but in this case the current standard does
> not say it's should be signed, though it looks reasonable and proposal for
> new version of standard require that.

Either way should work.  I'm not opposed to changing it.  :)

> I attach a new patch which fixes all of the problems. It's kinda large, must
> most changes are technical. Everything builds for me.

Thanks!  I've applied the patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040426/014023.html
(through 014029.html).

The only thing I changed was to turn a few occurrences of (*P).f into
P->f, and adjust it a bit to apply to current CVS.

Thanks a lot!

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list