llvm::CloneAndPruneIntoFromInst

Clone and prune OldFunc into NewFunc starting at a given instruction.

Synopsis

Declared in <llvm/Transforms/Utils/Cloning.h>

void
CloneAndPruneIntoFromInst(
    Function* NewFunc,
    Function const* OldFunc,
    Instruction const* StartingInst,
    ValueToValueMapTy& VMap,
    bool ModuleLevelChanges,
    SmallVectorImpl<ReturnInst*>& Returns,
    char const* NameSuffix,
    ClonedCodeInfo& CodeInfo);

Description

Behaves like CloneAndPruneFunctionInto, but begins cloning at StartingInst rather than at the entry block.

Parameters

NameDescription
NewFuncDestination function that receives the pruned clone.
OldFuncSource function to clone from.
StartingInstFirst instruction of OldFunc to begin cloning at.
VMapMapping from old values to new ones; updated during cloning.
ModuleLevelChangesWhether module-level value remapping is allowed.
ReturnsFilled with return instructions from the cloned body.
NameSuffixSuffix appended to cloned value names.
CodeInfoCollector for statistics about the cloned code.