Alexander Poddey
2015-May-31 05:11 UTC
[LLVMdev] how to get an independent copy of a function?
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
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>
Apparently Analagous Threads
- [LLVMdev] copy value of a global's data field to another global
- [LLVMdev] copy value of a global's data field to another global
- [LLVMdev] list of available/valid values near an instruction
- [LLVMdev] casting Constant * to value *?
- [LLVMdev] size of const_ptr for array index