[LLVMdev] Instruction Insertion

Grégory Ruch gregory.ruch at heig-vd.ch
Thu Aug 11 05:06:50 PDT 2011


Hi everybody,

I'm trying to implement a LLVM Pass that insert instructions into a
basicblock.

I'm using a FunctionPass and I want to add somthing like this :

%tmp = alloca i32, align 4
%tmp2 = alloca i32, align 4

store i32 10, i32* %tmp
store i32 2, i32* %tmp2

%tmp3 = add i32 %tmp, %tmp2

I try to follow the official tuto, I think this part is out of date.
http://llvm.org/docs/ProgrammersManual.html#simplechanges
I'm using IRBuilder to create an alloc instruction but I can not for now.

Someone could help me to get started ?

Thanks !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110811/abed41f1/attachment.html>


More information about the llvm-dev mailing list