ΒΆllvm::Function* CloneFunction(
    llvm::Function* F,
    llvm::ValueToValueMapTy& VMap,
    llvm::ClonedCodeInfo* CodeInfo = nullptr)

Description

Return a copy of the specified function and add it to that function's module. Also, any references specified in the VMap are changed to refer to their mapped value instead of the original one. If any of the arguments to the function are in the VMap, the arguments are deleted from the resultant function. The VMap is updated to include mappings from all of the instructions and basicblocks in the function from their old to new values. The final argument captures information about the cloned code if non-null.

Declared at: llvm/include/llvm/Transforms/Utils/Cloning.h:131

Parameters

llvm::Function* F
llvm::ValueToValueMapTy& VMap
llvm::ClonedCodeInfo* CodeInfo = nullptr