[LLVMdev] [PATCH]: Add range iterators to Extract/InsertValueInst indices

Chandler Carruth chandlerc at google.com
Tue Mar 3 00:38:05 PST 2015


Looks good.

On Tue, Mar 3, 2015 at 12:22 AM, Daniel Berlin <dberlin at dberlin.org> wrote:

> diff --git a/include/llvm/IR/Instructions.h
> b/include/llvm/IR/Instructions.h
> index 83f9d04..1a77675 100644
> --- a/include/llvm/IR/Instructions.h
> +++ b/include/llvm/IR/Instructions.h
> @@ -1908,6 +1908,9 @@ public:
>    typedef const unsigned* idx_iterator;
>    inline idx_iterator idx_begin() const { return Indices.begin(); }
>    inline idx_iterator idx_end()   const { return Indices.end(); }
> +  inline iterator_range<idx_iterator> indices() const {
> +    return iterator_range<idx_iterator>(idx_begin(), idx_end());
> +  }
>
>    Value *getAggregateOperand() {
>      return getOperand(0);
> @@ -2019,6 +2022,9 @@ public:
>    typedef const unsigned* idx_iterator;
>    inline idx_iterator idx_begin() const { return Indices.begin(); }
>    inline idx_iterator idx_end()   const { return Indices.end(); }
> +  inline iterator_range<idx_iterator> indices() const {
> +    return iterator_range<idx_iterator>(idx_begin(), idx_end());
> +  }
>
>    Value *getAggregateOperand() {
>      return getOperand(0);
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150303/d44bb90f/attachment.html>


More information about the llvm-dev mailing list