Displaying 3 results from an estimated 3 matches for "xxxinsrtinfo".
Did you mean:
xxinstrinfo
2016 Sep 04
1
How to insert instructions before each function calls?
On Sun, Sep 4, 2016 at 7:44 AM, Ryan Taylor <ryta1203 at gmail.com> wrote:
> Mehdi,
>
> Sorry, I misread his original post.
>
> So something like:
>
> XXXInsrtInfo *XII; // target instruction info
> MachineBasicBlock::iterator MI = MachineBasicBlock(YourCallInst);
> MachineBasicBlock *MBB = YourCallInst->getParent(); // basic block
> location of your call inst
> BuildMI(*MBB, MI, DebugLoc(), XII->get(XXX:::INSTRUCTION)......);
>...
2016 Sep 05
2
How to insert instructions before each function calls?
...>
>
> On Sep 4, 2016 10:20, "SHUCAI YAO" <yaos4 at mcmaster.ca> wrote:
>
>
> On Sun, Sep 4, 2016 at 7:44 AM, Ryan Taylor <ryta1203 at gmail.com> wrote:
> Mehdi,
>
> Sorry, I misread his original post.
>
> So something like:
>
> XXXInsrtInfo *XII; // target instruction info
> MachineBasicBlock::iterator MI = MachineBasicBlock(YourCallInst);
> MachineBasicBlock *MBB = YourCallInst->getParent(); // basic block location of your call inst
> BuildMI(*MBB, MI, DebugLoc(), XII->get(XXX:::INSTRUCTION)......);
>
>...
2016 Sep 04
2
How to insert instructions before each function calls?
So one way might look like this:
IRBuilder<> Builder(&*BB); // BB = Function::iterator OR IRBuilder<>
Builder(CallInst->getParent());
Builder.SetInsertPoint(CallInst);
InstructionClass *YourNewInstruction =
builder.CreateInstructionClass(.....); // InstructionClass = type of
instruction you are inserting
-Ryan
On Sat, Sep 3, 2016 at 6:04 PM, Ryan Taylor <ryta1203 at