[llvm-dev] cloning function

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 26 08:57:00 PDT 2020


What happens when it's called via a function pointer? (What compilation
errors or assertions are generated?)

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

On Tue, Oct 13, 2020 at 8:14 AM sangeeta chowdhary via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hello Everyone,
>
> I am writing an llvm pass which clones a function.
> For example, foo is cloned to my_foo.
> 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 Utils/CloneFunction.cpp. I am wondering how I can handle the
> case when function is called using a function pointer. Any insights or
> leads on how this can be achieved in llvm?
>
> Regards,
> Sangeeta
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201026/07c3f5ae/attachment.html>


More information about the llvm-dev mailing list