[LLVMdev] GEP::getIndexValid() with other iterators

Matthijs Kooijman matthijs at stdin.nl
Tue Jul 22 23:54:16 PDT 2008


Hi Chris,


> I'd prefer to not turn this into a template.  Why not just define a  
> version that takes an array of uint64_t's or something like that?
because I want to be able to pass in iterators. I could define a version that
takes std<uint64_t>::iterators, but next thing we know, we also need them for
lists, SmallVectors, etc. That's why one of the original getIndexedType
methods is a template, and that's why I think it makes sense to make another
one a template.

Any particular objections to this? Is the code size increase a problem?
AFAICS, in cases where you need this method, it will be a tradeoff between
speed (having to iterate all your indices and create a new list with the
Value* versions) and code size (having a version of getIndexedPointer that can
handle your particular flavour of iterator).

Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080723/51e4e3b6/attachment.sig>


More information about the llvm-dev mailing list