<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 3, 2021 at 11:55 AM zxhuan via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I am trying to replace calls to a function, say foo() with calls to my_foo(). In the IR file, there is no call to foo(). However, foo() will be called during execution. </div></div></blockquote><div><br></div><div>Can't say I'm following here ^ there is no call to foo() but it is called during execution? Is it called indirectly (eg: void (*x)() = foo; x(); )? is the call in another module/not this IR file?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I can't use the conventional way to do it (i.e. locate the call instruction, create a call site and then create a call to my_foo(), then replace all uses with the return value of my_foo()), because you can't locate the call instruction. So I tried to swap the name of foo() and my_foo(). However, this only results in the original function with the new name being called. I know I must have missed some steps, resulting in the reference to the original function still existing after the renaming. The question is, what is the missing step? Thank you so much for reading my description. I hope I make my question clear.</div><div><br></div><div>Best,</div><div>Jason</div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>