[LLVMdev] about creating the first value of the storeinst

marwayusuf at feng.bu.edu.eg marwayusuf at feng.bu.edu.eg
Sun Nov 10 02:51:39 PST 2013


Dear All

I'm trying to create storeInst using

StoreInst *SI = new StoreInst(val, AI, BB);

AI is an alloca instruction previously created, BB is the basicBlock I want to put instructionsi in. Val is the value to store.

I've created val from a genericValue like this:

Value* val = ConstantInt::get(getGlobalContext(), Result.IntVal);

Result is the genericValue

However I keep getting this error:

void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.


What is wrong about my code?


Thanks a million in advance.


Regards,
Marwa Yusuf
Teaching Assistant - Computer Engineering Department
Faculty of Engineering - Benha University
E-JUST MSc Student
Computer Science & Engineering Dept.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131110/c3153537/attachment.html>


More information about the llvm-dev mailing list