Structures
The following structures are available globally.
-
The abstract layout of a type, describing the relative offsets of its stored properties.
See moreDeclaration
Swift
public struct AbstractTypeLayout : Sendableextension AbstractTypeLayout: Hashable -
The evaluation context of an abstract interpreter.
See moreDeclaration
Swift
struct AbstractContext<Domain> : Equatable, Sendable where Domain : AbstractDomainextension AbstractContext: CustomStringConvertible -
Undocumented
See moreDeclaration
Swift
struct AbstractInterpreter<Domain> : Sendable where Domain : AbstractDomain -
An object in an abstract interpreter.
See moreDeclaration
Swift
struct AbstractObject<Domain> : Equatable, Sendable where Domain : AbstractDomainextension AbstractObject: CustomStringConvertible -
A control-flow graph.
This data structure describes relation between the basic blocks of a function. The direction of the graph’s edges denotes the direction of the control flow from one block to another: there an edge from
See moreAtoBif the former’s terminator points to the latter.Declaration
Swift
struct ControlFlowGraph : Sendableextension ControlFlowGraph: CustomStringConvertible -
A tree whose nodes are basic blocks and where a node immediately dominates its children.
Definitions:
- A block
b1in a control-flow graph dominates a blockb2if every path from the entry tob2must go throughb1. By definition, every node dominates itself. - A block
b1strictly dominates a blockb2ifb1dominatesb2andb1 != b2. - A block
b1immediately dominates a blockb2ifb1strictly dominatesb2and there is no blockb3that strictly dominatesb2.
A dominator tree encodes the dominance relation of a control graph as a tree where a node is a basic blocks and its children are those it immediately dominates.
See moreDeclaration
Swift
struct DominatorTree : Sendableextension DominatorTree: CustomStringConvertible - A block
-
A spanning tree of a control flow graph.
See moreDeclaration
Swift
private struct SpanningTree : Sendable -
A region of the program rooted at a definition.
A lifetime rooted at a definition
dis a region starting immediately afterdand covering a set of uses dominated byd. The “upper boundaries” of a lifetime are the program points immediately after the uses sequenced last in that region.See moreNote
The definition of an operandoisn’t part ofo‘s lifetime.Declaration
Swift
struct Lifetime : Sendable -
A module lowered to Hylo IR.
A lowered module is a collection of IR functions and a collection of constant IR values, which represent nominal types, traits, and global bindings. These entities may not necessarily have a definition. When they don’t, they denote a declaration known to be defined in another module.
See moreDeclaration
Swift
public struct Module : Sendableextension Module: CustomStringConvertibleextension Module: TextOutputStreamable -
Creates an access on an object.
IR generation sometimes cannot determine the capability used to access an object, as this information is kept implicit in Hylo sources. For example, a
See morelet-binding declaration will actually request asinkcapability on its right hand side if the binding escapes. In these cases, IR generation will emitaccessinstructions with the set capabilities that may be inferred from the syntax. These instructions are expected to be “reifed” during IR analysis so that only a single capability is requested.Declaration
Swift
public struct Access : RegionEntryextension Access: ReifiableAccessextension Access: LifetimeExtenderextension Access: CustomStringConvertible -
Projects a value from a subscript bundle.
See moreDeclaration
Swift
public struct ProjectBundle : Instructionextension ProjectBundle: ReifiableAccessextension ProjectBundle: LifetimeExtenderextension ProjectBundle: CustomStringConvertible -
Computes a
See moresourceaddress value advanced byoffsetbytes.Declaration
Swift
public struct AdvancedByBytes : Instructionextension AdvancedByBytes: LifetimeExtenderextension AdvancedByBytes: CustomStringConvertible -
Computes a
sourceaddress advanced bycountstrides of its referred type.The stride of a type is the number of bytes from the start of an instance to the start of the next when stored in contiguous memory.
See moreDeclaration
Swift
public struct AdvancedByStrides : Instructionextension AdvancedByStrides: LifetimeExtenderextension AdvancedByStrides: CustomStringConvertible -
Exposes a captured access.
See moreDeclaration
-
Projects the address of a union payload, viewed as an instance of a given type.
See moreDeclaration
Swift
public struct OpenUnion : RegionEntryextension OpenUnion: LifetimeExtenderextension OpenUnion: CustomStringConvertible -
Projects a value.
See moreDeclaration
Swift
public struct Project : RegionEntryextension Project: LifetimeExtenderextension Project: CustomStringConvertible -
Computes the address of storage for a field or sub-field of a record, given the record’s address.
Does not access memory.
See moreDeclaration
Swift
public struct SubfieldView : Instructionextension SubfieldView: LifetimeExtenderextension SubfieldView: CustomStringConvertible -
Creates existential container wrapping the address of a witness.
See moreDeclaration
Swift
public struct WrapExistentialAddr : Instructionextension WrapExistentialAddr: LifetimeExtenderextension WrapExistentialAddr: CustomStringConvertible -
An instruction marking an exit from a region.
See moreDeclaration
Swift
public struct RegionExit<Entry> where Entry : RegionEntryextension RegionExit: LifetimeCloserextension RegionExit: CustomStringConvertibleextension RegionExit: Sendable where Entry: Sendable -
The monomorphization of a function.
See moreDeclaration
Swift
private struct Monomorphizer : InstructionTransformer -
How to translate the contents of a function being inlined.
See moreDeclaration
Swift
private struct InliningTranslation : InstructionTransformer -
Classification of a record type’s subfields into uninitialized, initialized, and consumed sets.
See moreDeclaration
Swift
private struct SubfieldsByInitializationState : Sendable -
A basic block in a Hylo IR function.
A basic blocks is sequence of instructions free of conditional control flow. It may also accept arguments representing values that are notionally defined before its first instruction.
See moreDeclaration
Swift
public struct Block : Sendable -
A reference to a method or subscript bundle.
See moreDeclaration
Swift
public struct BundleReference<T> : Hashable, Sendable where T : BundleDeclextension BundleReference: CustomStringConvertible -
The witness of a type’s conformance to the
See moreCollectiontrait from the standard library.Declaration
Swift
struct CollectionWitness : Sendable -
Where, how, and under what conditions a type satisfies the requirements of a trait.
See moreDeclaration
Swift
public struct Conformance : Sendable -
Hylo’s IR emitter.
The emitter transforms well-formed, typed ASTs to a representation suitable for flow-sensitive analysis. IR generated from the emitter may be incomplete and must go through mandatory passes before it can be fed to code generation.
You create an instance by calling
Emitter.withInstance, providing the module in which IR should be incorporated and a diagnostic log. Then, the two main entry points are:incorporateTopLevelDeclarations: incorporates the top-level declarations of a module’s AST into its corresponding IR form.incorporateSyntheticDeclarations: generates the implementations of the synthesized declarations that are notionally part of a module. This method is called after definite deinitialization.
Other entry points may be used during IR passes (e.g.,
emitDeinit).See moreNote
Unless documented otherwise, the methods ofEmittertype insert IR inself.moduleatself.insertionPoint, anchoring new instructions at the given source range, namedsitein their parameter lists.Declaration
Swift
struct Emitter : Sendable -
A collection of basic blocks representing a lowered function.
See moreDeclaration
Swift
public struct Function : Sendable -
Declaration
Swift
public struct InstructionID : Hashable, Sendableextension InstructionID: CustomStringConvertible -
Unlike an identity, an index is not stable: inserting or removing instructions from the containing block may invalidate existing indices.
See moreSee also
InstructionIDDeclaration
Swift
public struct InstructionIndex : Hashable, Sendable -
The witness of a type’s conformance to the
See moreIteratortrait from the standard library.Declaration
Swift
struct IteratorWitness : Sendable -
A digit in base 64.
The textual description of a
Base64Digitis a single printable ASCII character, determined with the following table:┌────────────────────────────────────────────────────────┐ | 00 ... 09 | \u{0030} ... \u{0039} | decimal digits | | 10 ... 35 | \u{0061} ... \u{007a} | lower case letters | | 36 ... 61 | \u{0041} ... \u{005a} | upper case letters | | 62 | \u{002e} | period | | 63 | \u{005f} | underscore | └────────────────────────────────────────────────────────┘This character set is suitable for use in LLVM assembly identifiers.
See moreDeclaration
Swift
public struct Base64Digit : Hashableextension Base64Digit: RawRepresentableextension Base64Digit: Comparableextension Base64Digit: LosslessStringConvertible -
An unsigned integer whose textual representation uses a variable-length code in base 64.
The textual representation of a
Base64VarUIntis satisfies the following properties:- Small values use fewer characters than larger values.
- The length of the representation can be determined by looking at just the first character.
The textual representation of
vis composed of 1 tonASCII characters (0 < n < 12), writtenan.vis decoded as follows:- If
a0 < 51, thenn = 1andv = a0. - If
a0 == 51, thenn = 2andv = 50 + a1. - If
a0 == 52, thenn = 3andv = 114 + 64 * a1 + a2. - Otherwise,
n = a0andvis the sum ofai * 64^(a0 - i)for1 <= i < a0.
Declaration
Swift
public struct Base64VarUInt : Hashableextension Base64VarUInt: RawRepresentableextension Base64VarUInt: Comparableextension Base64VarUInt: TextOutputStreamableextension Base64VarUInt: LosslessStringConvertible -
The payload of a
See moreDemangledSymbol.entity.Declaration
Swift
public struct DemangledEntity : Hashable, Sendableextension DemangledEntity: CustomStringConvertible -
The demangled description of a synthesized function.
See moreDeclaration
Swift
public struct DemangledSynthesizedFunction : Hashable, Sendableextension DemangledSynthesizedFunction: CustomStringConvertible -
Hylo’s demangling algorithm.
See moreDeclaration
Swift
struct Demangler : Sendable -
Hylo’s mangling algorithm.
See moreDeclaration
Swift
struct Mangler : Sendable -
The type of a witness table.
See moreDeclaration
Swift
public struct WitnessTableType : TypeProtocol, CustomStringConvertible -
Converts an address to a built-in pointer value.
This instruction doesn’t extend the lifetime of its operand. The value of the converted pointer is only valid within the scope of the source address.
See moreDeclaration
Swift
public struct AddressToPointer : Instruction -
Allocates memory on the stack.
See moreDeclaration
-
Branches unconditionally to the start of a basic block.
See moreDeclaration
-
Invokes
calleewithargumentsand writes its result tooutput.
See morecalleemust have a lambda type; the type of the instruction must be the same as output type of the callee.operandsmust contain as many operands as the callee’s type.Declaration
-
Invokes the built-in function
See morecallee, passingoperandsas the argument list.Declaration
Swift
public struct CallBuiltinFunction : Instructionextension CallBuiltinFunction: CustomStringConvertible -
Invokes one variant of
See morebundlewithargumentsand writes its result tooutput.Declaration
-
Invokes
See morecallee, which is a foreign function interface, withoperands.Declaration
-
Captures and stores a remote part.
Well-formed IR guarantees the following invariants:
- The provenances of
targetcontain a singlealloc_stack. - A
capture ... inis post-dominated by at least onerelease_captureson the storage in which it has stored an access.
Declaration
- The provenances of
-
Branches conditionally to the start of a basic block.
See moreDeclaration
-
Creates the internal representation of constant string allocated statically.
The result is a 64-bit integer corresponding to the byte representation of a string in Hylo.
See moreDeclaration
-
Deallocates memory previously allocated by
See morealloc_stack.Declaration
Swift
public struct DeallocStack : Instruction -
Accesses the value passed to a generic parameter.
See moreDeclaration
Swift
public struct GenericParameter : Instructionextension GenericParameter: CustomStringConvertible -
Returns the address of a global binding.
See moreDeclaration
-
A load instruction.
See moreDeclaration
Swift
public struct Load : Instruction -
Unsafely sets the initialization state of storage.
See moreDeclaration
-
Copies the memory representation of the value stored
See moresourcetotarget.Declaration
Swift
public struct MemoryCopy : Instruction -
Initializes or assigns storage with a value.
See moreDeclaration
Swift
public struct Move : Instruction -
Converts a built-in pointer value to an address.
This instruction doesn’t extend the lifetime of its operand. The address unsafely refers to the memory referenced by the pointer.
See moreDeclaration
Swift
public struct PointerToAddress : Instructionextension PointerToAddress: CustomStringConvertible -
Releases accesses captures in an allocation.
See moreDeclaration
Swift
public struct ReleaseCaptures : Instruction -
A return instruction.
See moreDeclaration
Swift
public struct Return : Terminator -
Stores
See moreobjectat the specified location.Declaration
Swift
public struct Store : Instruction -
Branches to one of several basic blocks.
See moreDeclaration
-
Copy the discriminator of a union container.
See moreDeclaration
Swift
public struct UnionDiscriminator : Instruction -
Branches to one of several basic blocks based on the discriminator of a union.
See moreDeclaration
-
Marks this execution path as unreachable, causing a fatal error otherwise.
See moreDeclaration
Swift
public struct Unreachable : Terminator -
Projects the address of an object.
See moreDeclaration
Swift
public struct Yield : Instruction -
The possibly synthetic declaration of a parameter to a Hylo IR function.
See moreDeclaration
Swift
public struct Parameter : Sendableextension Parameter: CustomStringConvertible -
A program lowered to Hylo IR.
See moreDeclaration
Swift
public struct Program : FrontEnd.Program -
The address of some statically allocated storage.
See moreDeclaration
Swift
public struct StaticStorage : Sendableextension StaticStorage: Equatableextension StaticStorage: Hashable -
The lowered (static) type of an entity.
Note: when qualified, this must be spelled IR.
See moreType(https://github.com/apple/swift/issues/67378)Declaration
Swift
public struct Type : Hashable, Sendable -
A pair representing the use of a value in an instruction.
See moreDeclaration
Swift
public struct Use : Hashable, Sendable
View on GitHub
Structures Reference