[LLVMdev] how to get an independent copy of a function?

Yaron Keren yaron.keren at gmail.com
Sat May 30 23:29:04 PDT 2015


include/llvm/Transforms/Utils/Cloning.h


2015-05-31 8:11 GMT+03:00 Alexander Poddey <alexander.poddey at gmx.net>:

> Hi,
>
> I need to get a copy of a function which should be 'selfcontained'
> (independent from the original function). Just like in C making a copy of a
> functions source code, changing the name.
>
> I tried to copy the basic blocks and their instructions (clone) to a new
> function, but the module check gives 'referring to an argument in another
> function'.
> This seems obvious, because the clone on instruction level can not know
> that
> the instruction later should belong to another function.
>
> I could not find some sort of copy method on function level...
>
> Alex
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150531/5ffcc51d/attachment.html>


More information about the llvm-dev mailing list