-
A lookup table.
Declaration
Swift
typealias LookupTable = [String : Set<AnyDeclID>] -
A key in a type lookup table.
Declaration
Swift
typealias TypeLookupKey = ScopedValue<AnyType> -
Cached information about the extensions of a scope.
See moreDeclaration
Swift
struct ScopeExtensionCache -
The local instance being type checked.
Declaration
Swift
private(set) var local: TypedProgram { get } -
The instance being collaboratively typed checked.
Declaration
Swift
private var shared: SharedMutable<TypedProgram>? -
The updates of the shared cache currently pending.
Declaration
Swift
private var pendingUpdates: [SynchronizationUpdate] -
The number of updates in
pendingUpdatesthat should be synchronized early.Declaration
Swift
private var earlyUpdateCount: Int -
The number of early updates that are accumulated before being synchronized.
Declaration
Swift
private static let earlyUpdateThreshold: Int -
The declarations being currently type checked.
Declaration
Swift
var declsUnderChecking: Set<AnyDeclID> -
A map from declaration to its overarching type before it’s been type checked.
Declaration
Swift
var uncheckedType: DeclProperty<Memo<AnyType>> -
A map from declaration space to its members.
This map serves as cache for
lookup(_:memberOf:exposedTo). At no point is it guaranteed to be complete.Declaration
Swift
var scopeToMembers: [TypeLookupKey : LookupTable] -
A map from lexical scope to the names introduced in it.
This map serves as cache for
names(introducedIn:).Declaration
Swift
var scopeToNames: [AnyScopeID : LookupTable] -
A map from lexical scope to information about its extensions.
This map serves as cache for
appendExtensions(declaredIn:extending:to:).Declaration
Swift
var scopeToTypeToExtensions: [AnyScopeID : ScopeExtensionCache] -
A map from type to the traits to which in conforms in a given scope.
This map serves as cache for
conformedTraits(of:in:).Declaration
Swift
var typeToConformedTraits: [TypeLookupKey : Set<TraitType>] -
A map from type to its extensions in a given scope.
This map serves as cache for
extensions(of:exposedTo:).Declaration
Swift
var typeToExtensions: [TypeLookupKey : [AnyDeclID]] -
A map from trait to its bases (i.e., the traits that it refines).
This map serves as cache for
bases(of:).Declaration
Swift
var traitToBases: [TraitType : RefinementClosure] -
A map from trait to its direct successors in the trait dependency graph.
This map serves as cache for
successors(of:). -
A map from generic declarations to their (partially formed) environment.
Declaration
Swift
var partiallyFormedEnvironment: [AnyDeclID : GenericEnvironment] -
The strongly connected components of the trait dependency graph.
Declaration
Swift
var traitDependencyComponents: StronglyConnectedComponents<TraitType> -
Creates an instance for memoizing type checking results in
localand comminicating them to concurrent type checkers usingshared.Declaration
Swift
init(local: TypedProgram, shared: SharedMutable<TypedProgram>? = nil) -
Returns the value of the cache at
path.The value at
pathinself.localis read and returned if it isn’tnil. Otherwise, the value atpathinself.sharedis read, stored inself.local, and returned if it isn’tnil, unlessself.cacheisnilorignoreSharedCacheis true.Declaration
Swift
mutating func read<V>( _ path: WritableKeyPath<TypedProgram, V?>, ignoringSharedCache ignoreSharedCache: Bool = false ) -> V? -
Writes
valueto the cache atpath, applying the update withmerge.After the call,
self.local[keyPath: path] == value. Ifself.sharedisn’tnil, the update is recorded for the next synchronization round andself.earlyUpdateCountis incremented, unlessignoreSharedCacheistrue.mergeasserts that the update is monotonic.Declaration
Swift
mutating func write<V: Sendable>( _ value: V, at path: WritableKeyPath<TypedProgram, V>, ignoringSharedCache ignoreSharedCache: Bool = false, mergingWith merge: @Sendable @escaping (inout V, V) -> Void ) -
Writes
valueto the cache atpath, applying the update withmerge.After the call,
self.local[keyPath: path] == value. Ifself.sharedisn’tnil, the update is recorded for the next synchronization round andself.earlyUpdateCountis incremented, unlessignoreSharedCacheistrue.Declaration
Swift
mutating func write<V: Sendable>( _ value: V, at path: WritableKeyPath<TypedProgram, V>, ignoringSharedCache ignoreSharedCache: Bool = false ) where V: Monotonic -
Applies
self.read(path).Declaration
Swift
subscript<V>(m: WritableKeyPath<TypedProgram, V?>) -> V? where V : Equatable { mutating get } -
Applies all pending updates to the shared instance iff
earlyUpdateThresholdhas been reached, resettingself.earlyUpdateCount.Declaration
Swift
private mutating func synchronizeIfThresholdReached() -
Applies all pending updates to the shared instance.
Declaration
Swift
fileprivate mutating func synchronize()
View on GitHub