mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #81344 from DougGregor/infer-nonisolated-conformances-from-witnesses-6.2
This commit is contained in:
@@ -276,9 +276,7 @@ public:
|
||||
typename std::enable_if<Request::hasSplitCache>::type* = nullptr>
|
||||
void cacheNonEmptyOutput(const Request &request,
|
||||
typename Request::OutputType &&output) {
|
||||
bool inserted = cache.insert<Request>(request, std::move(output));
|
||||
assert(inserted && "Request result was already cached");
|
||||
(void) inserted;
|
||||
(void)cache.insert<Request>(request, std::move(output));
|
||||
}
|
||||
|
||||
/// Consults the request evaluator's cache for a split-cached request.
|
||||
|
||||
@@ -131,6 +131,8 @@ class alignas(1 << DeclAlignInBits) ProtocolConformance
|
||||
/// conformance definition.
|
||||
Type ConformingType;
|
||||
|
||||
friend class ConformanceIsolationRequest;
|
||||
|
||||
protected:
|
||||
// clang-format off
|
||||
//
|
||||
@@ -139,9 +141,13 @@ protected:
|
||||
union { uint64_t OpaqueBits;
|
||||
|
||||
SWIFT_INLINE_BITFIELD_BASE(ProtocolConformance,
|
||||
1+
|
||||
bitmax(NumProtocolConformanceKindBits, 8),
|
||||
/// The kind of protocol conformance.
|
||||
Kind : bitmax(NumProtocolConformanceKindBits, 8)
|
||||
Kind : bitmax(NumProtocolConformanceKindBits, 8),
|
||||
|
||||
/// Whether the computed actor isolation is nonisolated.
|
||||
IsComputedNonisolated : 1
|
||||
);
|
||||
|
||||
SWIFT_INLINE_BITFIELD_EMPTY(RootProtocolConformance, ProtocolConformance);
|
||||
@@ -161,9 +167,6 @@ protected:
|
||||
/// this conformance.
|
||||
IsPreconcurrencyEffectful : 1,
|
||||
|
||||
/// Whether the computed actor isolation is nonisolated.
|
||||
IsComputedNonisolated : 1,
|
||||
|
||||
/// Whether there is an explicit global actor specified for this
|
||||
/// conformance.
|
||||
HasExplicitGlobalActor : 1,
|
||||
@@ -198,6 +201,15 @@ protected:
|
||||
ProtocolConformance(ProtocolConformanceKind kind, Type conformingType)
|
||||
: ConformingType(conformingType) {
|
||||
Bits.ProtocolConformance.Kind = unsigned(kind);
|
||||
Bits.ProtocolConformance.IsComputedNonisolated = false;
|
||||
}
|
||||
|
||||
bool isComputedNonisolated() const {
|
||||
return Bits.ProtocolConformance.IsComputedNonisolated;
|
||||
}
|
||||
|
||||
void setComputedNonnisolated(bool value = true) {
|
||||
Bits.ProtocolConformance.IsComputedNonisolated = value;
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -591,14 +603,6 @@ class NormalProtocolConformance : public RootProtocolConformance,
|
||||
// Record the explicitly-specified global actor isolation.
|
||||
void setExplicitGlobalActorIsolation(TypeExpr *typeExpr);
|
||||
|
||||
bool isComputedNonisolated() const {
|
||||
return Bits.NormalProtocolConformance.IsComputedNonisolated;
|
||||
}
|
||||
|
||||
void setComputedNonnisolated(bool value = true) {
|
||||
Bits.NormalProtocolConformance.IsComputedNonisolated = value;
|
||||
}
|
||||
|
||||
public:
|
||||
NormalProtocolConformance(Type conformingType, ProtocolDecl *protocol,
|
||||
SourceLoc loc, DeclContext *dc,
|
||||
@@ -622,7 +626,6 @@ public:
|
||||
Bits.NormalProtocolConformance.HasComputedAssociatedConformances = false;
|
||||
Bits.NormalProtocolConformance.SourceKind =
|
||||
unsigned(ConformanceEntryKind::Explicit);
|
||||
Bits.NormalProtocolConformance.IsComputedNonisolated = false;
|
||||
Bits.NormalProtocolConformance.HasExplicitGlobalActor = false;
|
||||
setExplicitGlobalActorIsolation(options.getGlobalActorIsolationType());
|
||||
}
|
||||
@@ -714,6 +717,9 @@ public:
|
||||
return ExplicitSafety::Unspecified;
|
||||
}
|
||||
|
||||
/// Whether this conformance has explicitly-specified global actor isolation.
|
||||
bool hasExplicitGlobalActorIsolation() const;
|
||||
|
||||
/// Determine whether we've lazily computed the associated conformance array
|
||||
/// already.
|
||||
bool hasComputedAssociatedConformances() const {
|
||||
|
||||
Reference in New Issue
Block a user