Commit Graph

3433 Commits

Author SHA1 Message Date
Erik Eckstein
3c76464c1c rename withConcurrent -> withSendable
That was missed when "concurrent" was renamed to "sendable"
2024-03-13 09:58:31 +01:00
Rintaro Ishizaki
58e70e8535 Merge pull request #72103 from rintaro/astgen-stringliteral
[ASTGen] Generate interpolated string literal
2024-03-13 10:08:15 +09:00
Allan Shortlidge
c0303e0e7d Sema: Requestify Obj-C requirements map computation.
Avoids repeatedly rebuilding requirement maps during witness resolution.
2024-03-11 15:37:00 -07:00
Slava Pestov
f36b509eff AST: Remove ProtocolDecl::hasInverseMarking() 2024-03-07 12:22:33 -05:00
Slava Pestov
12626628bd AST: Remove AssociatedTypeDecl::hasInverseMarking() 2024-03-07 12:22:33 -05:00
Slava Pestov
dcea491dbe Sema: Remove inference of conditional Copyable conformance from generic parameters 2024-03-06 22:47:54 -05:00
Rintaro Ishizaki
e5592c7984 [ASTGen] Generate interpolated string literal 2024-03-06 10:32:00 -08:00
eeckstein
d1ec089c72 Merge pull request #72088 from language-core/main
chore: fix some comments
2024-03-06 10:08:50 +01:00
Anthony Latsis
fd93eea16b Merge pull request #70608 from AnthonyLatsis/unqualified-ident
[NFC] AST: Merge `SimpleIdentTypeRepr` & `GenericIdentTypeRepr` into `IdentTypeRepr`
2024-03-06 09:41:16 +03:00
Kavon Farvardin
e2d33ecd5f Merge pull request #71878 from kavon/ncgenerics-mangling-2
NCGenerics: New Inverse Mangling 3DS XL
2024-03-05 18:15:40 -08:00
Kavon Farvardin
215bd3cab4 Mangling: handle inverse requirements 2024-03-05 14:19:00 -08:00
cui fliter
127077b3aa chore: fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-03-05 17:23:22 +08:00
Alex Hoppen
aa955655ab Merge pull request #72048 from Jamezzzb/#56350
#56350 - Give Identifier a hasUnderscoredNaming() helper
2024-03-04 20:13:01 -08:00
James Brown
2c281208de 56350 - Give Identifier a hasUnderscoredNaming() helper and in the places currently using str().startsWith, change it to use the new helper. 2024-03-04 19:34:11 -05:00
Ellie Shin
8ffd8efe2d Merge branch 'main' into es-check-exp 2024-03-02 14:55:17 -08:00
Anthony Latsis
a315b22ff7 Remove non-essential uses of SimpleIdentTypeRepr & GenericIdentTypeRepr 2024-03-02 14:59:21 +03:00
Anthony Latsis
68746a0579 [NFC] AST: Rename IdentTypeReprUnqualifiedIdentTypeRepr 2024-03-02 08:28:47 +03:00
Ellie Shin
30669fca65 Currently when checking if resilience check can be bypassed within a package,
we only check if the loaded module is built from a package interface. This is
not enough as a binary module could just contain exportable decls if built with
experimental-skip-non-exportable-decls, essentially resulting in content equivalent
to interface content. This might be made a default behavior so this PR requires
a module to opt in to allow non-resilient access by a participating client in the
same package.

Since it affects module format, SWIFTMODULE_VERSION_MINOR is updated.

rdar://123651270
2024-03-01 15:13:58 -08:00
Slava Pestov
d88faf3626 AST: Move a couple of declarations to a more logical location 2024-03-01 15:46:59 -05:00
Slava Pestov
4a1b0c80cd RequirementMachine: Install placeholder requirement signature if completion fails
I did this if there was a request cycle but forgot the other obvious case.
2024-02-29 18:13:28 -05:00
Slava Pestov
f2bd764381 AST: Fix crash with circular raw value
Fixes rdar://problem/123543175.
2024-02-26 19:56:19 -05:00
Slava Pestov
6ac91cde5d Merge pull request #71821 from slavapestov/inheritance-clause-fixes
Refactor protocol inheritance clauses and existential layout for non-copyable generics
2024-02-24 11:58:03 -05:00
Slava Pestov
48d814b7aa AST: Remove ProtocolDecl::requiresInvertible() 2024-02-24 07:25:59 -05:00
Slava Pestov
9f0564c0e2 AST: Replace a ProtocolDecl::requiresInvertible() call with ProtocolDecl::inheritsFrom() 2024-02-24 07:25:59 -05:00
Slava Pestov
61ecdead7b Sema: Replace sole usage of TypeDecl::hasMarking() with getDirectlyInheritedNominalTypeDecls() 2024-02-24 07:25:59 -05:00
Slava Pestov
a801ac37de AST: Re-implement ProtocolDecl::inheritsFrom() to use getAllInheritedProtocols() 2024-02-24 07:25:59 -05:00
Slava Pestov
443919a9bf AST: Introduce ProtocolDecl::getAllInheritedProtocols() 2024-02-24 07:25:59 -05:00
Slava Pestov
1267f87251 AST: Fancier getPlaceholderRequirementSignature() 2024-02-24 07:25:59 -05:00
Ellie Shin
68e3488e7b Merge pull request #71779 from apple/es-pb
Allow resilience bypassing package optimization for all decls within a package boundary.
2024-02-23 12:51:01 -08:00
Ben Barham
ef8825bfe6 Migrate llvm::Optional to std::optional
LLVM has removed llvm::Optional, move over to std::optional. Also
clang-format to fix up all the renamed #includes.
2024-02-21 11:20:06 -08:00
Ellie Shin
eedd0ddf78 When package optimization is enabled, treat public decls as non-resilient
as well besides package decls if in the same package boundary.

Resolves rdar://123344579
2024-02-21 00:20:47 -08:00
Slava Pestov
e7d7f6f69f RequirementMachine: Add Copyable/Escapable requirements to 'placeholder' generic signatures
If we fail to build a generic signature (or requirement signature of a
protocol) because of a request cycle or because Knuth-Bendix completion
failed, we would create a placeholder signature with no requirements.

However in a move-only world, a completely unconstrained generic
parameter might generate spurious diagnostics when used in a copyable
way. For this reason, let's outfit these placeholder signatures with
a default set of conformance requirements to Copyable and Escapable.
2024-02-20 18:26:05 -05:00
Pavel Yaskevich
11ef6e58d8 Merge pull request #71659 from xedin/noncopyable-circularity-fixes
[AST/Sema] NonCopyableGenerics: Address some of the request circularity issues
2024-02-20 12:38:16 -08:00
Pavel Yaskevich
b6af269933 [AST] Remove TypeDecl::hasInverse and move canBe{Copyable, Escapable} to NominalTypeDecl` 2024-02-19 13:04:44 -08:00
Pavel Yaskevich
c81db8e149 [AST] NonCopyableGenerics: Expand hasInverseMarking to support associated type declarations
This is required for `ASTPrinter` to wrap the protocol that has
associated type with inverses in a feature block.
2024-02-19 10:37:16 -08:00
Pavel Yaskevich
68b49b6fd0 [AST] NonCopyableGenerics: Don't resolve requirements in NominalTypeDecl::hasInverseMarking
TypeRepr for the subject should be already bound to a generic type
declaration, so there is no need to resolve the requirement to
check that.
2024-02-16 17:55:53 -08:00
Pavel Yaskevich
15b79c5bde [AST/Sema] NFC: Remove obsolete getMarking(...) and InvertibleAnnotationRequest 2024-02-16 17:55:52 -08:00
Pavel Yaskevich
cc7258152c [AST] NoCopyableGenerics: Remove last use of getMarking(...)
Introduce `NominalTypeDecl::has{Marking, InverseMarking}` methods
that split the logic from `InvertibleAnnotationRequest`
2024-02-16 17:55:52 -08:00
Pavel Yaskevich
6e0cfb5ac4 [AST] NonCopyableGenerics: Remove a few uses for getMarking(...).getPositive() 2024-02-16 17:55:52 -08:00
Pavel Yaskevich
355e02d7e9 [AST] Route inverse marking detection through TypeDecl::hasInverseMarking
The first step on the path to dismangle `TypeDecl::getMarking()`.
2024-02-16 17:55:52 -08:00
Pavel Yaskevich
3257ff4755 [AST] Move hasInverseMarking into ProtocolDecl and produce a loc of found inverse 2024-02-16 17:55:52 -08:00
Pavel Yaskevich
09ab12df20 [AST] Simplify ProtocolDecl::requiresInvertible check
The method only needs to know about the presence of inverses
for the given invertiable protocol.
2024-02-16 17:55:52 -08:00
Ellie Shin
3a80ed705b Merge pull request #71663 from apple/es-bypass-opt
Move in-package resilience bypassing logic to a resilience check with accessing module
2024-02-16 14:12:35 -08:00
Slava Pestov
1c24b880ec Merge pull request #70467 from AnthonyLatsis/recursive-member-typerepr
AST: Remodel `MemberTypeRepr` to be recursive
2024-02-16 11:36:31 -05:00
Konrad `ktoso` Malawski
e9c7f3c382 [Distributed] Target identifiers for protocol calls (#70928) 2024-02-16 07:19:20 -08:00
Kavon Farvardin
4fb90d3e2c Merge pull request #71654 from kavon/ncgenerics-test-fixes-kavon-v14
Ncgenerics test fixes kavon v14
2024-02-15 14:04:50 -08:00
Ellie Shin
d7516fa00f Clean up 2024-02-15 13:27:12 -08:00
Ellie Shin
0802ff507e Move bypassing resilience in package logic to
isResilient(ModuleDecl, ResilienceExpansion).

isResilient() returns the decl's resilience by definition
and should not be altered whether bypassing optimization
is enabled or not. The overloaded isResilient(ModuleDecl..)
is used for accessing a decl from a client module, which is
the appropriate place to opt in for non-resilience in package.

Resolves rdar://123031292
2024-02-15 13:04:51 -08:00
Kavon Farvardin
63ed8ec4a6 NCGenerics: handle legacy definition of Sendable
This should be a temporary measure while bootstrapping the feature.
2024-02-15 11:07:49 -08:00
Michael Gottesman
23ab974574 Merge pull request #71567 from gottesmm/transferring-param
[transferring] Implement transferring result and clean up transferring param support by making transferring a bit on param instead of a ParamSpecifier.
2024-02-14 17:54:48 -08:00