[LLVMdev] API design (and Boost and tr1)

David Greene dag at cray.com
Tue Jul 10 12:00:16 PDT 2007


On Tuesday 10 July 2007 13:37, Chris Lattner wrote:

> > Why?  I can't think of a case where a client uses that but can't use the
> > iterator version (just pass Value, Value+num).  I'd rather not maintain
> > two interfaces with identical semantics.
>
> If nothing else, for temporary migration reasons.  First step is to get
> the new interface in, second step is to migrate clients, third step is to
> remove the old one.

Actually, I've made all of the changes to the clients already.  There weren't
a whole lot,. really.

> > The iterator and one-argument constructors appear to cover 99% of the
> > cases and the two-argument clients can often just pass Use::op_iterators
> > directly.  I've even found one case where we can eliminate a temporary
> > vector.
>
> nice!

Unfortunately, I spoke too soon.  op_iterators are not compatible with this
code because the existing interfaces require a Value ** pointing to
contiguous memory.  You can't get that directly with op_iterators because 
of the additional Use information there.  Too bad.

                                                         -Dave



More information about the llvm-dev mailing list