IRInstruction

public protocol IRInstruction : IRValue

An IRInstruction is a value that directly represents an instruction and in particular the result of the execution of that instruction.

  • metadata Extension method

    Retrieves all metadata entries attached to this instruction.

    Declaration

    Swift

    public var metadata: AttachedMetadata { get }
  • addMetadata(_:kind:) Extension method

    Sets a metadata attachment, erasing the existing metadata attachment if it already exists for the given kind.

    Declaration

    Swift

    public func addMetadata(_ metadata: IRMetadata, kind: AttachedMetadata.PinnedKind)

    Parameters

    metadata

    The metadata to attach to this global value.

    kind

    The kind of metadata to attach.

  • addMetadata(_:kind:) Extension method

    Sets a metadata attachment, erasing the existing metadata attachment if it already exists for the given kind.

    Declaration

    Swift

    public func addMetadata(_ metadata: IRMetadata, kind: UInt32)

    Parameters

    metadata

    The metadata to attach to this global value.

    kind

    The kind of metadata to attach.

  • opCode Extension method

    Retrieves the opcode associated with this Instruction.

    Declaration

    Swift

    public var opCode: OpCode { get }
  • debugLocation Extension method

    Retrieves the current debug location of this instruction.

    Declaration

    Swift

    public var debugLocation: DebugLocation? { get set }
  • previous() Extension method

    Obtain the instruction that occurs before this one, if it exists.

    Declaration

    Swift

    public func previous() -> Instruction?
  • next() Extension method

    Obtain the instruction that occurs after this one, if it exists.

    Declaration

    Swift

    public func next() -> Instruction?
  • parentBlock Extension method

    Retrieves the parent basic block that contains this instruction, if it exists.

    Declaration

    Swift

    public var parentBlock: BasicBlock? { get }
  • firstUse Extension method

    Retrieves the first use of this instruction.

    Declaration

    Swift

    public var firstUse: Use? { get }
  • uses Extension method

    Retrieves the sequence of instructions that use the value from this instruction.

    Declaration

    Swift

    public var uses: AnySequence<Use> { get }
  • removeFromParent() Extension method

    Removes this instruction from a basic block but keeps it alive.

    Note

    To ensure correct removal of the instruction, you must invalidate any remaining references to its result values.

    Declaration

    Swift

    public func removeFromParent()