[LLVMdev] how to use "new instruction()"

Jonathan Roelofs jonathan at codesourcery.com
Thu Apr 16 17:48:44 PDT 2015


You're probably looking for this method: 
https://github.com/llvm-mirror/llvm/blob/master/include/llvm/IR/Instruction.h#L395

Jon

On 4/16/15 6:38 PM, zhi chen wrote:
> I read the tutorial document, but I didn't understand the it and Ops
> fields of instruction class well. Can any one give me an example?
>
> Instruction *newInstr = new Instruction(Type *ty, unsigned it, Use *Ops,
> unsigned NumOps, Instruction *InsertBefore);
>
> For example, I have an *instruction *pInst *without no the type of
> operation in advance. If I want to create a new instruction which is
> similar to the *pInst. *How can I do it?
>
> Any help will be appreciated. Thanks.
>
> Best,
> Zhi
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded



More information about the llvm-dev mailing list