llvm::CloneFunctionAttributesInto

Clone OldFunc's attributes into NewFunc, transforming values based on the mappings in VMap.

Synopsis

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

void
CloneFunctionAttributesInto(
    Function* NewFunc,
    Function const* OldFunc,
    ValueToValueMapTy& VMap,
    bool ModuleLevelChanges,
    ValueMapTypeRemapper* TypeMapper = nullptr,
    ValueMaterializer* Materializer = nullptr);

Parameters

NameDescription
NewFuncDestination function that receives the cloned attributes.
OldFuncSource function whose attributes are copied.
VMapMapping used to remap attribute values.
ModuleLevelChangesWhether module-level value remapping is allowed.
TypeMapperOptional remapper for types encountered while cloning.
MaterializerOptional materializer for values missing from VMap.