Skip to content

Commit 3c90b17

Browse files
authored
Merge pull request #3454 from swiftwasm/maxd/main-merge
Resolve conflicts with the `main` branch
2 parents 1fb4007 + c782554 commit 3c90b17

File tree

311 files changed

+4068
-2738
lines changed

Some content is hidden

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

311 files changed

+4068
-2738
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
set(SWIFT_HOST_VARIANT_SDK WINDOWS CACHE STRING "")
3+
set(SWIFT_HOST_VARIANT_ARCH i686 CACHE STRING "")
4+
5+
# NOTE(compnerd) disable the tools, we are trying to build just the standard
6+
# library.
7+
set(SWIFT_INCLUDE_TOOLS NO CACHE BOOL "")
8+
9+
# NOTE(compnerd) cannot build tests since the tests require the toolchain
10+
set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "")
11+
12+
# NOTE(compnerd) cannot build docs since that requires perl
13+
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")
14+
15+
# NOTE(compnerd) these are part of the toolchain, not the runtime.
16+
set(SWIFT_BUILD_SYNTAXPARSERLIB NO CACHE BOOL "")
17+
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")
18+
19+
# NOTE(compnerd) build with the compiler specified, not a just built compiler.
20+
set(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER YES CACHE BOOL "")
21+

cmake/modules/Libdispatch.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ foreach(sdk ${DISPATCH_SDKS})
7070
foreach(arch ${ARCHS})
7171
set(LIBDISPATCH_VARIANT_NAME "libdispatch-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch}")
7272

73+
if(sdk MATCHES WINDOWS)
74+
set(SWIFT_LIBDISPATCH_COMPILER_TRIPLE_CMAKE_ARGS -DCMAKE_C_COMPILER_TARGET=${SWIFT_SDK_WINDOWS_ARCH_${arch}_TRIPLE};-DCMAKE_CXX_COMPILER_TARGET=${SWIFT_SDK_WINDOWS_ARCH_${arch}_TRIPLE})
75+
endif()
76+
77+
7378
if(NOT sdk STREQUAL ANDROID)
7479
set(SWIFT_LIBDISPATCH_SYSTEM_PROCESSOR -DCMAKE_SYSTEM_PROCESSOR=${arch})
7580
endif()
@@ -81,6 +86,7 @@ foreach(sdk ${DISPATCH_SDKS})
8186
-DCMAKE_AR=${CMAKE_AR}
8287
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
8388
${SWIFT_LIBDISPATCH_COMPILER_CMAKE_ARGS}
89+
${SWIFT_LIBDISPATCH_COMPILER_TRIPLE_CMAKE_ARGS}
8490
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
8591
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
8692
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}

docs/LibraryEvolution.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,16 @@ Always Emit Into Client
269269
A function, computed property or subscript annotated as ``@_alwaysEmitIntoClient``
270270
is similar to an ``@inlinable`` declaration, except the declaration is
271271
not part of the module's ABI, meaning that the client must always emit
272-
their own copy.
272+
their own copy. As a result:
273273

274-
As a result, removing a declaration annotated as ``@_alwaysEmitIntoClient``
275-
is a binary-compatible source-breaking change.
276-
277-
.. admonition:: TODO
278-
279-
The implementation of ``@_alwaysEmitIntoClient`` is incomplete and
280-
should probably graduate to having its own evolution proposal.
274+
- Removing a declaration annotated as ``@_alwaysEmitIntoClient`` is a
275+
`binary-compatible source-breaking change`.
276+
- Adding ``@_alwaysEmitIntoClient`` to a declaration breaks ABI but is a
277+
source-compatible change.
278+
- Removing ``@_alwaysEmitIntoClient`` from a declaration is a
279+
binary-compatible change. It also requires updating the availability
280+
to at least the OS version where the attribute was removed. As a result,
281+
it may be a source-breaking change.
281282

282283
Default Argument Expressions
283284
----------------------------

include/swift/AST/Decl.h

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ class alignas(1 << DeclAlignInBits) Decl : public ASTAllocated<Decl> {
514514
IsComputingSemanticMembers : 1
515515
);
516516

517-
SWIFT_INLINE_BITFIELD_FULL(ProtocolDecl, NominalTypeDecl, 1+1+1+1+1+1+1+1+1+1+1+8+16,
517+
SWIFT_INLINE_BITFIELD_FULL(ProtocolDecl, NominalTypeDecl, 1+1+1+1+1+1+1+1+1+8+16,
518518
/// Whether the \c RequiresClass bit is valid.
519519
RequiresClassValid : 1,
520520

@@ -527,12 +527,6 @@ class alignas(1 << DeclAlignInBits) Decl : public ASTAllocated<Decl> {
527527
/// Whether the existential of this protocol conforms to itself.
528528
ExistentialConformsToSelf : 1,
529529

530-
/// Whether the \c ExistentialTypeSupported bit is valid.
531-
ExistentialTypeSupportedValid : 1,
532-
533-
/// Whether the existential of this protocol can be represented.
534-
ExistentialTypeSupported : 1,
535-
536530
/// True if the protocol has requirements that cannot be satisfied (e.g.
537531
/// because they could not be imported from Objective-C).
538532
HasMissingRequirements : 1,
@@ -4151,21 +4145,6 @@ class ProtocolDecl final : public NominalTypeDecl {
41514145
Bits.ProtocolDecl.ExistentialConformsToSelf = result;
41524146
}
41534147

4154-
/// Returns the cached result of \c existentialTypeSupported or \c None if it
4155-
/// hasn't yet been computed.
4156-
Optional<bool> getCachedExistentialTypeSupported() {
4157-
if (Bits.ProtocolDecl.ExistentialTypeSupportedValid)
4158-
return Bits.ProtocolDecl.ExistentialTypeSupported;
4159-
4160-
return None;
4161-
}
4162-
4163-
/// Caches the result of \c existentialTypeSupported
4164-
void setCachedExistentialTypeSupported(bool supported) {
4165-
Bits.ProtocolDecl.ExistentialTypeSupportedValid = true;
4166-
Bits.ProtocolDecl.ExistentialTypeSupported = supported;
4167-
}
4168-
41694148
bool hasLazyRequirementSignature() const {
41704149
return Bits.ProtocolDecl.HasLazyRequirementSignature;
41714150
}
@@ -4175,7 +4154,6 @@ class ProtocolDecl final : public NominalTypeDecl {
41754154
friend class RequirementSignatureRequest;
41764155
friend class ProtocolRequiresClassRequest;
41774156
friend class ExistentialConformsToSelfRequest;
4178-
friend class ExistentialTypeSupportedRequest;
41794157
friend class InheritedProtocolsRequest;
41804158

41814159
public:
@@ -4264,12 +4242,6 @@ class ProtocolDecl final : public NominalTypeDecl {
42644242
/// contain 'Self' in 'parameter' or 'other' position.
42654243
bool isAvailableInExistential(const ValueDecl *decl) const;
42664244

4267-
/// Determine whether we are allowed to refer to an existential type
4268-
/// conforming to this protocol. This is only permitted if the types of
4269-
/// all the members do not contain any associated types, and do not
4270-
/// contain 'Self' in 'parameter' or 'other' position.
4271-
bool existentialTypeSupported() const;
4272-
42734245
/// Returns a list of protocol requirements that must be assessed to
42744246
/// determine a concrete's conformance effect polymorphism kind.
42754247
PolymorphicEffectRequirementList getPolymorphicEffectRequirements(
@@ -5986,6 +5958,10 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
59865958
/// Returns 'true' if the function is distributed.
59875959
bool isDistributed() const;
59885960

5961+
/// Get (or synthesize) the associated remote function for this one.
5962+
/// For example, for `distributed func hi()` get `func _remote_hi()`.
5963+
AbstractFunctionDecl *getDistributedActorRemoteFuncDecl() const;
5964+
59895965
PolymorphicEffectKind getPolymorphicEffectKind(EffectKind kind) const;
59905966

59915967
// FIXME: Hack that provides names with keyword arguments for accessors.

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -920,9 +920,6 @@ NOTE(object_literal_resolve_import,none,
920920

921921
ERROR(use_local_before_declaration,none,
922922
"use of local variable %0 before its declaration", (DeclNameRef))
923-
ERROR(unsupported_existential_type,none,
924-
"protocol %0 can only be used as a generic constraint because it has "
925-
"Self or associated type requirements", (Identifier))
926923

927924
ERROR(decl_does_not_exist_in_module,none,
928925
"%select{%error|type|struct|class|enum|protocol|variable|function}0 "

include/swift/AST/EducationalNotes.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
// EDUCATIONAL_NOTES(DIAG_ID, EDUCATIONAL_NOTE_FILENAMES...)
2323

24-
EDUCATIONAL_NOTES(unsupported_existential_type,
25-
"associated-type-requirements.md")
24+
EDUCATIONAL_NOTES(could_not_use_member_on_existential,
25+
"existential-member-access-limitations.md")
2626

2727
EDUCATIONAL_NOTES(cannot_pass_type_to_non_ephemeral, "temporary-pointers.md")
2828
EDUCATIONAL_NOTES(cannot_pass_type_to_non_ephemeral_warning,

include/swift/AST/IRGenOptions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ class IRGenOptions {
372372
/// Pull in runtime compatibility shim libraries by autolinking.
373373
Optional<llvm::VersionTuple> AutolinkRuntimeCompatibilityLibraryVersion;
374374
Optional<llvm::VersionTuple> AutolinkRuntimeCompatibilityDynamicReplacementLibraryVersion;
375+
Optional<llvm::VersionTuple>
376+
AutolinkRuntimeCompatibilityConcurrencyLibraryVersion;
375377

376378
JITDebugArtifact DumpJIT = JITDebugArtifact::None;
377379

include/swift/AST/KnownIdentifiers.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ IDENTIFIER(decodeIfPresent)
6666
IDENTIFIER(Decoder)
6767
IDENTIFIER(decoder)
6868
IDENTIFIER_(Differentiation)
69+
IDENTIFIER_WITH_NAME(PatternMatchVar, "$match")
6970
IDENTIFIER(dynamicallyCall)
7071
IDENTIFIER(dynamicMember)
7172
IDENTIFIER(Element)

include/swift/AST/TypeCheckRequests.h

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -287,32 +287,6 @@ class ExistentialConformsToSelfRequest :
287287
void cacheResult(bool value) const;
288288
};
289289

290-
/// Determine whether we are allowed to refer to an existential type conforming
291-
/// to this protocol.
292-
class ExistentialTypeSupportedRequest :
293-
public SimpleRequest<ExistentialTypeSupportedRequest,
294-
bool(ProtocolDecl *),
295-
RequestFlags::SeparatelyCached> {
296-
public:
297-
using SimpleRequest::SimpleRequest;
298-
299-
private:
300-
friend SimpleRequest;
301-
302-
// Evaluation.
303-
bool evaluate(Evaluator &evaluator, ProtocolDecl *decl) const;
304-
305-
public:
306-
// Cycle handling.
307-
void diagnoseCycle(DiagnosticEngine &diags) const;
308-
void noteCycleStep(DiagnosticEngine &diags) const;
309-
310-
// Separate caching.
311-
bool isCached() const { return true; }
312-
Optional<bool> getCachedResult() const;
313-
void cacheResult(bool value) const;
314-
};
315-
316290
class PolymorphicEffectRequirementsRequest :
317291
public SimpleRequest<PolymorphicEffectRequirementsRequest,
318292
PolymorphicEffectRequirementList(EffectKind, ProtocolDecl *),
@@ -933,18 +907,18 @@ class IsDistributedActorRequest :
933907
bool isCached() const { return true; }
934908
};
935909

936-
/// Determine whether the given func is distributed.
937-
class IsDistributedFuncRequest :
938-
public SimpleRequest<IsDistributedFuncRequest,
939-
bool(FuncDecl *),
940-
RequestFlags::Cached> {
910+
/// Obtain the 'remote' counterpart of a 'distributed func'.
911+
class GetDistributedRemoteFuncRequest :
912+
public SimpleRequest<GetDistributedRemoteFuncRequest,
913+
AbstractFunctionDecl *(AbstractFunctionDecl *),
914+
RequestFlags::Cached> {
941915
public:
942-
using SimpleRequest::SimpleRequest;
916+
using SimpleRequest::SimpleRequest;
943917

944918
private:
945-
friend SimpleRequest;
919+
friend SimpleRequest;
946920

947-
bool evaluate(Evaluator &evaluator, FuncDecl *func) const;
921+
AbstractFunctionDecl *evaluate(Evaluator &evaluator, AbstractFunctionDecl *func) const;
948922

949923
public:
950924
// Caching

include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ SWIFT_REQUEST(TypeChecker, EnumRawTypeRequest,
8787
Type(EnumDecl *), Cached, NoLocationInfo)
8888
SWIFT_REQUEST(TypeChecker, ExistentialConformsToSelfRequest,
8989
bool(ProtocolDecl *), SeparatelyCached, NoLocationInfo)
90-
SWIFT_REQUEST(TypeChecker, ExistentialTypeSupportedRequest,
91-
bool(ProtocolDecl *), SeparatelyCached, NoLocationInfo)
9290
SWIFT_REQUEST(TypeChecker, ExtendedTypeRequest, Type(ExtensionDecl *), Cached,
9391
NoLocationInfo)
9492
SWIFT_REQUEST(TypeChecker, ResultBuilderTypeRequest, Type(ValueDecl *),
@@ -100,7 +98,7 @@ SWIFT_REQUEST(TypeChecker, IsDefaultActorRequest,
10098
Cached, NoLocationInfo)
10199
SWIFT_REQUEST(TypeChecker, IsDistributedActorRequest, bool(NominalTypeDecl *),
102100
Cached, NoLocationInfo)
103-
SWIFT_REQUEST(TypeChecker, IsDistributedFuncRequest, bool(FuncDecl *),
101+
SWIFT_REQUEST(TypeChecker, GetDistributedRemoteFuncRequest, AbstractFunctionDecl *(AbstractFunctionDecl *),
104102
Cached, NoLocationInfo)
105103
SWIFT_REQUEST(TypeChecker, GlobalActorInstanceRequest,
106104
VarDecl *(NominalTypeDecl *),

0 commit comments

Comments
 (0)