Skip to content

Commit 6594b7d

Browse files
Merge pull request #4681 from swiftwasm/release/5.7
[pull] swiftwasm-release/5.7 from release/5.7
2 parents fca3cbf + a14f05e commit 6594b7d

File tree

94 files changed

+1708
-992
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1708
-992
lines changed

include/swift-c/StaticMirror/BinaryScan.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/// SWIFTSTATICMIRROR_VERSION_MINOR should increase when there are API additions.
2626
/// SWIFTSTATICMIRROR_VERSION_MAJOR is intended for "major" source/ABI breaking changes.
2727
#define SWIFTSTATICMIRROR_VERSION_MAJOR 0
28-
#define SWIFTSTATICMIRROR_VERSION_MINOR 3 // Added filed type info gather
28+
#define SWIFTSTATICMIRROR_VERSION_MINOR 4 // Added opaque associated type's protocol requirements
2929

3030
SWIFTSTATICMIRROR_BEGIN_DECLS
3131

@@ -115,6 +115,9 @@ SWIFTSTATICMIRROR_PUBLIC swift_static_mirror_string_ref_t
115115
SWIFTSTATICMIRROR_PUBLIC swift_static_mirror_string_ref_t
116116
swift_static_mirror_type_alias_get_substituted_type_mangled_name(
117117
swift_static_mirror_type_alias_t);
118+
SWIFTSTATICMIRROR_PUBLIC swiftscan_string_set_t *
119+
swift_static_mirror_type_alias_get_opaque_type_requirements(
120+
swift_static_mirror_type_alias_t);
118121

119122
// swift_static_mirror_associated_type_info query methods
120123
SWIFTSTATICMIRROR_PUBLIC swift_static_mirror_string_ref_t

include/swift/ABI/GenericContext.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,18 @@ class TargetGenericRequirementDescriptor {
145145
return Protocol;
146146
}
147147

148+
/// Retreive the raw value of the Protocol requirement pointer.
149+
int32_t getUnresolvedProtocolAddress() const {
150+
assert(getKind() == GenericRequirementKind::Protocol);
151+
return Protocol.getUnresolvedProtocolAddress();
152+
}
153+
154+
/// Retreive the offset to the Protocol field
155+
constexpr inline auto
156+
getProtocolOffset() const -> typename Runtime::StoredSize {
157+
return offsetof(typename std::remove_reference<decltype(*this)>::type, Protocol);
158+
}
159+
148160
/// Retrieve the right-hand type for a SameType or BaseClass requirement.
149161
llvm::StringRef getMangledTypeName() const {
150162
assert(getKind() == GenericRequirementKind::SameType ||
@@ -301,7 +313,8 @@ class TargetGenericEnvironment
301313
}
302314
};
303315

304-
using GenericEnvironmentDescriptor = TargetGenericEnvironment<InProcess>;
316+
using GenericEnvironmentDescriptor =
317+
TargetGenericEnvironment<InProcess>;
305318

306319
/// CRTP class for a context descriptor that includes trailing generic
307320
/// context description.

include/swift/ABI/Metadata.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2996,7 +2996,11 @@ struct TargetOpaqueTypeDescriptor final
29962996
return cd->getKind() == ContextDescriptorKind::OpaqueType;
29972997
}
29982998
};
2999-
2999+
3000+
template <template <typename Runtime> class ObjCInteropKind,
3001+
unsigned PointerSize>
3002+
using ExternalOpaqueTypeDescriptor = TargetOpaqueTypeDescriptor<
3003+
External<ObjCInteropKind<RuntimeTarget<PointerSize>>>>;
30003004
using OpaqueTypeDescriptor = TargetOpaqueTypeDescriptor<InProcess>;
30013005

30023006
/// The instantiation cache for generic metadata. This must be guaranteed

include/swift/ABI/MetadataRef.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,16 @@ class RelativeTargetProtocolDescriptorPointer {
308308
swiftPointer.getPointer()));
309309
}
310310

311+
/// Retrieve a reference to the protocol.
312+
int32_t getUnresolvedProtocolAddress() const {
313+
#if SWIFT_OBJC_INTEROP
314+
if (isObjC()) {
315+
return objcPointer.getUnresolvedOffset();
316+
}
317+
#endif
318+
return swiftPointer.getUnresolvedOffset();
319+
}
320+
311321
operator TargetProtocolDescriptorRef<Runtime>() const {
312322
return getProtocol();
313323
}

include/swift/AST/ActorIsolation.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ ActorIsolation getActorIsolation(ValueDecl *value);
193193
/// Determine how the given declaration context is isolated.
194194
ActorIsolation getActorIsolationOfContext(DeclContext *dc);
195195

196+
/// Check if both the value, and context are isolated to the same actor.
197+
bool isSameActorIsolated(ValueDecl *value, DeclContext *dc);
198+
196199
/// Determines whether this function's body uses flow-sensitive isolation.
197200
bool usesFlowSensitiveIsolation(AbstractFunctionDecl const *fn);
198201

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4820,9 +4820,6 @@ ERROR(distributed_actor_func_static,none,
48204820
ERROR(distributed_actor_func_not_in_distributed_actor,none,
48214821
"'distributed' method can only be declared within 'distributed actor'",
48224822
())
4823-
ERROR(distributed_method_requirement_must_be_async_throws,none, // FIXME(distributed): this is an implementation limitation we should lift
4824-
"'distributed' protocol requirement %0 must currently be declared explicitly 'async throws'",
4825-
(DeclName))
48264823
ERROR(distributed_actor_user_defined_special_property,none,
48274824
"property %0 cannot be defined explicitly, as it conflicts with "
48284825
"distributed actor synthesized stored property",

include/swift/AST/DistributedDecl.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
//
1616
//===----------------------------------------------------------------------===//
1717

18-
#ifndef SWIFT_DECL_TYPECHECKDISTRIBUTED_H
19-
#define SWIFT_DECL_TYPECHECKDISTRIBUTED_H
18+
#ifndef SWIFT_DECL_DISTRIBUTEDDECL_H
19+
#define SWIFT_DECL_DISTRIBUTEDDECL_H
2020

2121
#include "swift/AST/ConcreteDeclRef.h"
2222
#include "swift/AST/DiagnosticEngine.h"
@@ -132,4 +132,6 @@ extractDistributedSerializationRequirements(
132132

133133
}
134134

135-
#endif /* SWIFT_DECL_TYPECHECKDISTRIBUTED_H */
135+
// ==== ------------------------------------------------------------------------
136+
137+
#endif /* SWIFT_DECL_DISTRIBUTEDDECL_H */

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,6 @@ namespace swift {
482482
// FrontendOptions.
483483
bool AllowModuleWithCompilerErrors = false;
484484

485-
/// Enable extensions of (sugared) bound generic types
486-
///
487-
/// \code
488-
/// extension [Int] { /**/ }
489-
/// \endcode
490-
bool EnableExperimentalBoundGenericExtensions = false;
491-
492485
/// A helper enum to represent whether or not we customized the default
493486
/// ASTVerifier behavior via a frontend flag. By default, we do not
494487
/// customize.

include/swift/Basic/RelativePointer.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,7 @@ class RelativeIndirectablePointerIntPair {
347347

348348
public:
349349
const ValueTy *getPointer() const & {
350-
static_assert(alignof(ValueTy) >= 2 && alignof(Offset) >= 2,
351-
"alignment of value and offset must be at least 2 to "
352-
"make room for indirectable flag");
353-
354-
Offset offset = (RelativeOffsetPlusIndirectAndInt & ~getIntMask());
350+
Offset offset = getUnresolvedOffset();
355351

356352
// Check for null.
357353
if (Nullable && offset == 0)
@@ -370,10 +366,17 @@ class RelativeIndirectablePointerIntPair {
370366
}
371367
}
372368

369+
Offset getUnresolvedOffset() const & {
370+
static_assert(alignof(ValueTy) >= 2 && alignof(Offset) >= 2,
371+
"alignment of value and offset must be at least 2 to "
372+
"make room for indirectable flag");
373+
Offset offset = (RelativeOffsetPlusIndirectAndInt & ~getIntMask());
374+
return offset;
375+
}
376+
373377
/// A zero relative offset encodes a null reference.
374378
bool isNull() const & {
375-
Offset offset = (RelativeOffsetPlusIndirectAndInt & ~getIntMask());
376-
return offset == 0;
379+
return getUnresolvedOffset() == 0;
377380
}
378381

379382
IntTy getInt() const & {

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,6 @@ def enable_resilience : Flag<["-"], "enable-resilience">,
313313
def enable_experimental_async_top_level :
314314
Flag<["-"], "enable-experimental-async-top-level">,
315315
HelpText<"Enable experimental concurrency in top-level code">;
316-
317-
def enable_experimental_bound_generic_extensions :
318-
Flag<["-"], "enable-experimental-bound-generic-extensions">,
319-
HelpText<"Enable experimental support for extensions of bound generic types">;
320316
}
321317

322318
// HIDDEN FLAGS

0 commit comments

Comments
 (0)