[LLVMdev] Creating a GEP instruction.

Rohith Goparaju rgoparaj at umail.iu.edu
Sun Apr 25 20:37:45 PDT 2010


  Thanks. The problem i'm facing is i want to get the address of the first
element of an array and i have also tried using the createInBoundsGEP which
takes the base pointer and the index value and a name. When i try passing
'0' as the index im running into problems.

Thanks,
Rohith.

On Sun, Apr 25, 2010 at 10:27 PM, Eli Friedman <eli.friedman at gmail.com>wrote:

> On Sun, Apr 25, 2010 at 5:15 PM, Rohith Goparaju <rgoparaj at umail.iu.edu>
> wrote:
> >  Hi,
> >
> >    I'm trying to create a GEP (inbounds) instruction . I was looking at
> the
> > createinboundsGEP method . I didnt get the inputiterator part. My
> question
> > how do i create a GEP instruction and what do i pass for the input
> iterator
> > arguments.
>
> Generic answer to "how do I create an X instruction": use llc
> -march=cpp on an IR file containing the instruction, and read the
> result.
>
> For this particular question, the simplest way to get appropriate
> iterators is to put the indices into an std::vector and pass in the
> .begin() and .end() of it.
>
> -Eli
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100425/4cbeeadb/attachment.html>


More information about the llvm-dev mailing list