Displaying 4 results from an estimated 4 matches for "createinstructionclass".
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 gmail.com> wrote:
> Take a look at IRBuilder and SetInsertPoint().
>
> On Sep 3, 2016 18:02, "SHUCAI YAO via llvm-dev" <llvm-dev at li...
2016 Sep 04
1
How to insert instructions before each function calls?
...e:
>>
>> 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
>>
>>
>> I’m not sure how the IRBuilder would work at the MI level, as Shucai was
>> asking.
>>
>>
>>
>>
>> On Sat, Sep 3, 2016 at 6:04 PM, Ryan Taylor <ryta1203 at...
2016 Sep 05
2
How to insert instructions before each function calls?
...t; wrote:
>>
>> 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
>>
>
> I’m not sure how the IRBuilder would work at the MI level, as Shucai was asking.
>
>>
>>
>>
>> On Sat, Sep 3, 2016 at 6:04 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:
>...
2016 Sep 03
2
How to insert instructions before each function calls?
I'm trying to insert some instructions before each function calls (before
arguments push):
lea %EAX, label ----- new instructions
mov [ESP+stacksize], %EAX ----- new instructions
push arg1
push arg2
...
push argn
call callee_name
I am a newbie to LLVM. I tried to use buildMI() to insert the instructions
in the lowercall() function. But I couldn't