[LLVMdev] error in InsertElementInst

Tim Northover t.p.northover at gmail.com
Sun Jul 20 05:20:55 PDT 2014


Hi Vasilis,

On 20 July 2014 12:57, Vasilis Koutsoumpos <bill_koutsoumpos at hotmail.com> wrote:
> Do you have any suggestions for these errors?

It looks like the constructor is private to make sure the type of the
vector and the overall instruction match up properly. You should use
InsertElementInst::Create instead (see
http://llvm.org/docs/doxygen/html/classllvm_1_1InsertElementInst.html).

Actually, it's usually better to create your instructions using the
IRBuilder class rather than directly. It handles inserting them into a
basic block more conveniently, and smooths out some of the differences
between various instructions (like this one).

Cheers.

Tim.



More information about the llvm-dev mailing list