FunctionType

public struct FunctionType : IRType

FunctionType represents a function’s type signature. It consists of a return type and a list of formal parameter types. The return type of a function type is a void type or first class type — except for LabelType and MetadataType.

  • The list of argument types.

    Declaration

    Swift

    public let argTypes: [IRType]
  • The return type of this function type.

    Declaration

    Swift

    public let returnType: IRType
  • Returns whether this function is variadic.

    Declaration

    Swift

    public let isVarArg: Bool
  • Creates a function type with the given argument types and return type.

    Note

    The context of this type is taken from it’s returnType

    Declaration

    Swift

    public init(argTypes: [IRType], returnType: IRType, isVarArg: Bool = false)

    Parameters

    argTypes

    A list of the argument types of the function type.

    returnType

    The return type of the function type.

    isVarArg

    Indicates whether this function type is variadic. Defaults to false.

  • Retrieves the underlying LLVM type object.

    Declaration

    Swift

    public func asLLVM() -> LLVMTypeRef
  • Declaration

    Swift

    public static func == (lhs: FunctionType, rhs: FunctionType) -> Bool