[LLVMdev] error in InsertElementInst

Vasilis Koutsoumpos bill_koutsoumpos at hotmail.com
Sun Jul 20 04:57:52 PDT 2014


Hello everybody,

What I am trying to do is to create a vector <4 x i32> and save some values to initialize the vector.
However, I am using the insertElementInst() and the errors I get are the following;

error: within this context
Instruction *Insert = new InsertElementInst(instr, emptyVec, index0, "test");
and
error: ‘llvm::InsertElementInst::InsertElementInst(llvm::Value*, llvm::Value*, llvm::Value*, const llvm::Twine&, llvm::Instruction*)’ is private

The code I have used is the following:
Type *Instr_vector = VectorType::get(Int32, 4);
Value *emptyVec = UndefValue::get(Instr_vector);
Constant* index0 =  Constant::getIntegerValue(u32Ty, llvm::APInt(32, 0));
Instruction *Insert = new InsertElementInst(instr, emptyVec, index0, "test");
b->getInstList().insertAfter(Xor_flip, Insert);

Do you have any suggestions for these errors?
Thanks in Advance,
Vasilis
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140720/adf4b191/attachment.html>


More information about the llvm-dev mailing list