Monomorphizer
private struct Monomorphizer : InstructionTransformer
The monomorphization of a function.
-
The arguments for which instructions are monomorphized.
Declaration
Swift
let specialization: GenericArguments -
The scope in which instructions are monomorphized.
Declaration
Swift
let scopeOfUse: AnyScopeID -
A table from generic value parameter to the allocation of the storage containing its value.
Generic value parameters are rewritten as local variables initialized at the beginning of the monomorphized function. Generic value arguments don’t require deinitialization. Their local storage is deallocated before each rewritten return instruction.
Declaration
Swift
let rewrittenGenericValue: OrderedDictionary<GenericParameterDecl.ID, InstructionID> -
A map from basic block in
sourceto its corresponding block inresult. -
A map from instruction in
sourceto its corresponding instruction inresult.Declaration
Swift
var rewrittenInstruction: [InstructionID : InstructionID] -
Returns the canonical, monomorphized form of
t.Declaration
Swift
func transform(_ t: AnyType, in ir: inout IR.Program) -> AnyType -
Returns a monomorphized copy of
o. -
Returns a monomorphized copy of
b. -
Returns a monomorphized copy of
c.Declaration
-
Returns a monomorphized copy of
c.Declaration
Swift
private func transform(_ c: FunctionReference, in ir: inout IR.Program) -> FunctionReference -
Returns a monomorphized copy of
fspecialized byzfor use inscopeOfUse.If
fis a trait requirement, the result is a monomorphized version of that requirement’s implementation, usingato identify the requirement’s receiver. Otherwise, the result is a monomorphized copy off.Declaration
View on GitHub