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.
-
metadataExtension methodRetrieves all metadata entries attached to this instruction.
Declaration
Swift
public var metadata: AttachedMetadata { get } -
addMetadata(_:Extension methodkind: ) 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
metadataThe metadata to attach to this global value.
kindThe kind of metadata to attach.
-
addMetadata(_:Extension methodkind: ) 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
metadataThe metadata to attach to this global value.
kindThe kind of metadata to attach.
-
opCodeExtension methodRetrieves the opcode associated with this
Instruction.Declaration
Swift
public var opCode: OpCode { get } -
debugLocationExtension methodRetrieves the current debug location of this instruction.
Declaration
Swift
public var debugLocation: DebugLocation? { get set } -
previous()Extension methodObtain the instruction that occurs before this one, if it exists.
Declaration
Swift
public func previous() -> Instruction? -
next()Extension methodObtain the instruction that occurs after this one, if it exists.
Declaration
Swift
public func next() -> Instruction? -
parentBlockExtension methodRetrieves the parent basic block that contains this instruction, if it exists.
Declaration
Swift
public var parentBlock: BasicBlock? { get } -
firstUseExtension methodRetrieves the first use of this instruction.
Declaration
Swift
public var firstUse: Use? { get } -
usesExtension methodRetrieves the sequence of instructions that use the value from this instruction.
Declaration
Swift
public var uses: AnySequence<Use> { get } -
removeFromParent()Extension methodRemoves 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()
IRInstruction Protocol Reference