[LLVMdev] Creating a GEP instruction.

Eli Friedman eli.friedman at gmail.com
Sun Apr 25 19:27:28 PDT 2010


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




More information about the llvm-dev mailing list