Function
public struct Function : Sendable
A collection of basic blocks representing a lowered function.
-
A collection of blocks with stable identities.
Declaration
Swift
public typealias Blocks = DoublyLinkedList<Block> -
trueiff the function implements a subscript.Declaration
Swift
public let isSubscript: Bool -
The site in the source code to which the function corresponds..
Declaration
Swift
public let site: SourceRange -
The linkage of the function.
Declaration
Swift
public let linkage: Linkage -
The generic (a.k.a., compile-time) parameters of the function.
Declaration
Swift
public let genericParameters: [GenericParameterDecl.ID] -
The run-time parameters of the function.
Declaration
Swift
public let inputs: [Parameter] -
The type of the function’s output.
Declaration
Swift
public let output: AnyType -
The blocks in the function.
Declaration
Swift
public private(set) var blocks: Blocks { get } -
The entry of the function.
Declaration
Swift
public var entry: Blocks.Address? { get } -
Accesses the basic block at
address.Requires
addressmust be a valid address inself. -
trueiff the function takes generic parameters.Declaration
Swift
public var isGeneric: Bool { get } -
Appends to
selfa basic block inscopethat acceptsparameters, returning its address.The new block will become the function’s entry if
selfcontains no block beforeappendBlockis called.Declaration
Swift
mutating func appendBlock<T: ScopeID>( in scope: T, taking parameters: [IR.`Type`] ) -> Blocks.Address -
Removes the block at
address. -
Returns the control flow graph of
self.Declaration
Swift
func cfg() -> ControlFlowGraph -
The global identity of an IR function.
See moreDeclaration
View on GitHub