ΒΆllvm::Function* cloneFunctionDecl(
llvm::Module& Dst,
const llvm::Function& F,
llvm::ValueToValueMapTy* VMap = nullptr)
llvm::Function* cloneFunctionDecl(
llvm::Module& Dst,
const llvm::Function& F,
llvm::ValueToValueMapTy* VMap = nullptr)
Description
Clone a function declaration into a new module. This function can be used as the first step towards creating a callback stub (see makeStub), or moving a function body (see moveFunctionBody). If the VMap argument is non-null, a mapping will be added between F and the new declaration, and between each of F's arguments and the new declaration's arguments. This map can then be passed in to moveFunction to move the function body if required. Note: When moving functions between modules with these utilities, all decls should be cloned (and added to a single VMap) before any bodies are moved. This will ensure that references between functions all refer to the versions in the new module.
Declared at: llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h:527
Parameters
- llvm::Module& Dst
- const llvm::Function& F
- llvm::ValueToValueMapTy* VMap = nullptr