llvm::RemapFunction

Remap the operands, metadata, arguments, and instructions of a function.

Synopsis

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

void
RemapFunction(
    Function& F,
    ValueToValueMapTy& VM,
    RemapFlags Flags = RF_None,
    ValueMapTypeRemapper* TypeMapper = nullptr,
    ValueMaterializer* Materializer = nullptr,
    MetadataPredicate const* IdentityMD = nullptr);

Description

Calls MapValue() on prefix data, prologue data, and personality function; calls MapMetadata() on each attached MDNode; remaps the argument types using the provided TypeMapper; and calls RemapInstruction() on every instruction.

Parameters

NameDescription
FFunction to remap in place.
VMMapping from original values to remapped values.
FlagsRemapping flags that control mapper behavior.
TypeMapperOptional callback that remaps types while mapping values.
MaterializerOptional callback that materializes unmapped values.
IdentityMDOptional predicate for metadata that maps onto itself.