apple/swift
Glossary
Project-specific vocabulary. The fuller, canonical reference lives in docs/Lexicon.md.
Compiler pipeline
- Driver — the
swift/swiftcbinary that supervises a build (file discovery, job planning, calling the frontend, linking). Implemented inlib/Driver/andlib/DriverTool/. - Frontend —
swift -frontend, the per-invocation compiler that parses, type-checks, generates SIL, optimizes, and emits LLVM IR. Implemented inlib/Frontend/andlib/FrontendTool/. - Request evaluator — a generic memoization graph over typed requests; the backbone of lazy type checking. See
docs/RequestEvaluator.mdandlib/AST/Evaluator.cpp. - Subsystems — the high-level entry points of each pass. See
include/swift/Subsystems.h.
AST and types
- AST — abstract syntax tree, the parsed and type-checked program representation. Code in
lib/AST/. - Decl — a declaration node (
FuncDecl,StructDecl, ...). Defined ininclude/swift/AST/Decl.h. - Expr / Stmt — expression / statement nodes.
- TypeRepr — a syntactic type as written by the user (before type checking).
- Type — a canonical resolved type.
CanTypeis the canonical form. - Archetype — placeholder for a generic parameter or associated type within a generic context.
- Substitution — a mapping from generic parameters to concrete types.
- Conformance — the witness that a type satisfies a protocol;
ProtocolConformancein C++. - GenericSignature — the requirements (
where-clauses) on a set of generic parameters. Computed by the requirement machine inlib/AST/RequirementMachine/. - Sugared type — a type with surface syntax preserved (e.g.,
[Int]vsArray<Int>).
Constraint system
- CSGen / CSSimplify — constraint generation and constraint simplification (
lib/Sema/CSGen.cpp,CSSimplify.cpp). - TypeVariable — a placeholder during constraint solving.
- Solution — an assignment of types to type variables that makes all constraints hold.
- Disjunction — a constraint with multiple alternatives, used for overload resolution.
SIL
- SIL — Swift Intermediate Language. SSA-form IR between AST and LLVM IR. See
docs/SIL/. - Raw SIL — SIL fresh from SILGen, before mandatory passes have run.
- Canonical SIL — SIL after mandatory passes; valid input to IRGen.
- Mandatory passes — passes that the language semantics require (definite initialization, ARC ownership lowering, mandatory inlining, ...). Run regardless of
-O. - Performance passes — optimizations enabled by
-O/-Osize/-Owholemodule. - Ownership SIL (OSSA) — SIL with explicit ownership annotations (
owned,guaranteed,unowned). All raw and canonical SIL is OSSA today. - Function signature — calling-convention info: parameter ownership, indirect/direct passing, error result, etc.
IRGen and runtime
- IRGen — lowering canonical SIL to LLVM IR. Code in
lib/IRGen/, header API ininclude/swift/IRGen/. - Type metadata — runtime descriptors for types (size, alignment, generic args, conformances). Created/looked up in
stdlib/public/runtime/Metadata.cpp. - Witness table — runtime table of protocol-method implementations for a particular
(type, protocol)pair. - Existential container — boxed representation of a protocol-typed value (
Any,any P). - Heap object — a Swift class instance, prefixed with metadata + reference counts. See
stdlib/public/runtime/HeapObject.cpp. - Demangler — turns mangled symbols (e.g.,
$s4main3FooV3barfoo) into readable names. Implemented twice: a host-side library inlib/Demangling/and a runtime-side copy compiled into the runtime.
ClangImporter and module system
- ClangImporter — the embedded Clang instance that imports C and Objective-C declarations as Swift APIs. Code in
lib/ClangImporter/. .swiftmodule— binary serialized representation of a Swift module. Code inlib/Serialization/..swiftinterface— textual stable interface used for module evolution. Generated/loaded vialib/Frontend/ModuleInterfaceLoader.cpp.- Overlay — a Swift module that augments a C/Objective-C framework (e.g., the
Foundationoverlay). - Cross-import overlay — a module that auto-imports when two specific modules are imported together.
ABI and runtime concepts
- MangledName — stable encoded symbol; see
docs/ABI/Mangling.rst. - Reabstraction thunk — small wrapper used when a value's [abstraction pattern] needs to change at a call boundary.
- Type layout — physical layout (size/stride/alignment, extra inhabitants). See
docs/ABI/TypeLayout.rst. - Resilience — ABI-stable evolution mechanism; resilient types/fields are accessed indirectly so the layout can change. See
docs/LibraryEvolution.rst. - Library evolution — the policy + machinery that allows binary-stable libraries to evolve without breaking clients. Enabled with
-enable-library-evolution.
Concurrency
- Actor — reference type with isolated mutable state and async message-style access. Code in
stdlib/public/Concurrency/Actor.cppandActor.swift. - Task — unit of asynchronous work.
stdlib/public/Concurrency/Task*.{cpp,swift}. - Executor — runs tasks; can be serial (an actor's executor) or global. See
Executor.swift. - Sendable — protocol marking types safe to share across concurrency domains.
- Continuation — captured suspension point, used to bridge callback-based APIs.
Tools
- SourceKit — out-of-process IDE service used by Xcode and
sourcekit-lsp. Code intools/SourceKit/. - swift-syntax — the Swift-implemented syntax tree library; used in
lib/ASTGen/, macros, and refactoring. - gyb — "Generate Your Boilerplate", the Python templating system for repetitive stdlib code (
utils/gyb.py). Files end in.gyb.
Build and contribution
build-script—utils/build-script, the Python entry point for building everything.- Preset — a named bundle of
build-scriptarguments inutils/build-presets.ini. @swift_ci— the CI bot. Comment@swift_ci please teston a PR to trigger CI. Seedocs/ContinuousIntegration.md.update-checkout—utils/update-checkoutclones / updates the side-by-side repos at compatible revisions.
For terms not listed here, search docs/Lexicon.md or the LLVM lexicon.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.
Previous
Getting started
Next
By the numbers