[llvm-dev] Replacing operands in a call instruction

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Replacing operands in a call instruction

Jeremy Morse via llvm-dev
Hello,

I am trying to replace a pointer argument of a call instruction with another pointer argument( new argument value for the call instruction). What is the best way to do it? I could not find any hint/guidance on the web or LLVM manual.

Thanks,

--
Abid M. Malik
******************************************************
"I have learned silence from the talkative, toleration from the intolerant, and kindness from the unkind"---Gibran
"Success is not for the chosen few, but for the few who choose" --- John Maxwell
"Being a good person does not depend on your religion or status in life, your race or skin color, political views or culture. IT DEPENDS ON HOW GOOD YOU TREAT OTHERS"--- Abid
"The Universe is talking to us, and the language of the Universe is mathematics."----Abid
 

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Replacing operands in a call instruction

Jeremy Morse via llvm-dev
Hi Abid,

On Thu, 23 Jan 2020 at 19:03, Abid Malik via llvm-dev
<[hidden email]> wrote:
> I am trying to replace a pointer argument of a call instruction with another pointer argument( new argument value for the call instruction). What is the best way to do it? I could not find any hint/guidance on the web or LLVM manual.

You probably want CallBase::setArgOperand. You have to make sure the
types are the same of course, changing the type of an entity in LLVM
is substantially more involved.

Cheers.

Tim.
_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Replacing operands in a call instruction

Jeremy Morse via llvm-dev
Thanks! 

On Thu, Jan 23, 2020 at 3:32 PM Tim Northover <[hidden email]> wrote:
Hi Abid,

On Thu, 23 Jan 2020 at 19:03, Abid Malik via llvm-dev
<[hidden email]> wrote:
> I am trying to replace a pointer argument of a call instruction with another pointer argument( new argument value for the call instruction). What is the best way to do it? I could not find any hint/guidance on the web or LLVM manual.

You probably want CallBase::setArgOperand. You have to make sure the
types are the same of course, changing the type of an entity in LLVM
is substantially more involved.

Cheers.

Tim.


--
Abid M. Malik
******************************************************
"I have learned silence from the talkative, toleration from the intolerant, and kindness from the unkind"---Gibran
"Success is not for the chosen few, but for the few who choose" --- John Maxwell
"Being a good person does not depend on your religion or status in life, your race or skin color, political views or culture. IT DEPENDS ON HOW GOOD YOU TREAT OTHERS"--- Abid
"The Universe is talking to us, and the language of the Universe is mathematics."----Abid
 

_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev