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 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
metadata
The metadata to attach to this global value.
kind
The 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
metadata
The metadata to attach to this global value.
kind
The kind of metadata to attach.
-
opCode
Extension methodRetrieves the opcode associated with this
Instruction
.Declaration
Swift
public var opCode: OpCode { get }
-
debugLocation
Extension 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?
-
parentBlock
Extension methodRetrieves the parent basic block that contains this instruction, if it exists.
Declaration
Swift
public var parentBlock: BasicBlock? { get }
-
firstUse
Extension methodRetrieves the first use of this instruction.
Declaration
Swift
public var firstUse: Use? { get }
-
uses
Extension 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()