[llvm-commits] [PATCH (need approval)] Add support for InsertValue and ExtractValue to gep_type_iterator
Peter Collingbourne
peter at pcc.me.uk
Thu Jul 1 04:30:46 PDT 2010
On Wed, Jun 30, 2010 at 09:09:32PM -0700, Chris Lattner wrote:
> On Jun 30, 2010, at 12:39 PM, Peter Collingbourne wrote:
>
> > ---
> > Hi,
> >
> > This adds iv_type_iterator, ev_type_iterator and vce_type_iterator
> > to complement gep_type_iterator.
> >
> > I'm not 100% certain this is the right way to do this. Perhaps we
> > should introduce an Operator for generically accessing the index
> > iterators for {Insert,Extract}Values. This would work right now
> > because all the iterators are of underlying type const unsigned *
> > but of course this may change in the future.
>
> Hi Peter,
>
> What problem are you trying to solve here?
Hi Chris,
In another project (Klee) we needed to extend a procedure that
enumerated the types of a GEP to handle InsertValue and ExtractValue
(this procedure calculates the byte offset of the indices). To avoid
code duplication we decided to do this in a generic way by extending
the capabilities of gep_type_iterator.
I imagined this would also be useful for other users or perhaps LLVM
itself so we decided to make this a change to LLVM and contribute
it upstream.
Thanks,
--
Peter
More information about the llvm-commits
mailing list