<div dir="ltr">What happens when it's called via a function pointer? (What compilation errors or assertions are generated?)<br><br>But in the most general case, an indirect function call doesn't know what function it's calling - and if it doesn't know, what can you clone? Perhaps you may want to implement a wrapper function instead of a clone in that case? Depending on what your goals are</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 13, 2020 at 8:14 AM sangeeta chowdhary 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"><font color="#000000">Hello Everyone,<br></font><div><br></div><div><font color="#000000">I am writing an llvm pass which clones a function. </font></div><div><font color="#000000">For example, foo is cloned to my_foo.</font></div><div><font color="#000000">It has all the instructions which are in foo and it works fine till the function is not called using a function pointer.  I have used CloneFunction defined in <span style="font-variant-ligatures:no-common-ligatures;font-family:Monaco">Utils/CloneFunction.cpp. I am wondering how I can </span></font><span style="color:rgb(0,0,0);font-family:Monaco;font-variant-ligatures:no-common-ligatures">handle </span><font color="#000000"><span style="font-family:Monaco;font-variant-ligatures:no-common-ligatures">the case </span>when function<span style="font-family:Monaco;font-variant-ligatures:no-common-ligatures"> is called </span>using a function<span style="font-family:Monaco;font-variant-ligatures:no-common-ligatures"> pointer. Any insights or leads on how this can be achieved in llvm?</span></font></div><div><span style="font-variant-ligatures:no-common-ligatures;font-family:Monaco"><font color="#000000"><br></font></span></div><div><span style="font-variant-ligatures:no-common-ligatures;font-family:Monaco"><font color="#000000">Regards,</font></span></div><div><span style="font-variant-ligatures:no-common-ligatures;font-family:Monaco"><font color="#000000">Sangeeta</font></span></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>