IRConstant

public protocol IRConstant : IRValue

An IRConstant is an entity whose value doees not change during the runtime of a program. This includes global variables and functions, whose addresses are constant, and constant expressions.

  • constGEP(indices:) Extension method

    Perform a GEP (Get Element Pointer) with this value as the base.

    Declaration

    Swift

    public func constGEP(indices: [IRConstant]) -> IRConstant

    Parameters

    indices

    A list of indices that indicate which of the elements of the aggregate object are indexed.

    Return Value

    A value representing the address of a subelement of the given aggregate data structure value.

  • bitCast(to:) Extension method

    Build a constant bitcast to convert the given value to a value of the given type by just copying the bit pattern.

    Declaration

    Swift

    public func bitCast(to type: IRType) -> IRConstant

    Parameters

    type

    The destination type.

    Return Value

    A constant value representing the result of bitcasting this constant value to fit the given type.