Commit Graph

1744 Commits

Author SHA1 Message Date
QuietMisdreavus
f674b473ec introduce a @_documentation(...) attribute to influence SymbolGraphGen (#60242)
* add @_documentation(...) attribute to influence SymbolGraphGen

rdar://79049241
2022-09-06 14:12:42 -06:00
Alex Lorenz
8de79390be [interop][SwiftToCxx] add @_expose(Cxx) attribute support
This attribute instructs the compiler that this declaration should be included in the generated C++ bindings
2022-08-24 10:14:07 -07:00
Slava Pestov
5c32f2136e AST: Introduce RequirementKind::SameCount 2022-08-23 11:12:00 -04:00
Slava Pestov
cfb4e60a48 Merge pull request #60523 from slavapestov/fix-opened-generic-environment-identity
Serialization: Preserve identity of opened generic environments
2022-08-16 14:33:44 -04:00
Slava Pestov
b36f37cc72 Serialization: Preserve identity of opened generic environments
We used to create a new environment for each opened archetype, which is
incorrect when deserializing a nested type of another opened archetype.
2022-08-15 13:59:12 -04:00
swift-ci
73280e6ed5 Merge remote-tracking branch 'origin/main' into rebranch 2022-08-02 12:13:17 -07:00
Hamish Knight
9da53193da [AST] Remove ParameterTypeFlags from ParenType and TupleType
The last clients that relied on stashing parameter
type flags on these types are now gone.
2022-08-02 13:56:32 +01:00
swift-ci
2e1140c767 Merge remote-tracking branch 'origin/main' into rebranch 2022-07-29 09:14:45 -07:00
Ben Barham
ee8bc34795 [Serialization] Output precedence higher/lowerThan relations when valid
When allowing errors, do not output higher/lowerThan relations for
invalid precedencegroup declarations.

Resolves rdar://97362356.
2022-07-28 12:23:12 -07:00
swift-ci
5706f48a31 Merge remote-tracking branch 'origin/main' into rebranch 2022-07-20 19:14:34 -07:00
Pavel Yaskevich
225341e3d2 [Decl] Start storing and serializing "unavailability" bit per condition 2022-07-20 13:26:43 -07:00
Pavel Yaskevich
8185db433a [Serialization] Add a "unavailable" bit to conditional substitution record
A step towards supporting different opaque result type produced by a
`if #unavailable` block.
2022-07-20 13:26:41 -07:00
swift-ci
e9c324099a Merge remote-tracking branch 'origin/main' into rebranch 2022-07-18 16:13:31 -07:00
Alexis Laferrière
36b87d3c5c [Serialization] Use a more reliable macro to get the compiler tag
Use only the SWIFT_COMPILER_VERSION macro to check for swiftmodules
being written by the same compiler that reads it. In practice, it's the
macro used for release builds of the compiler.

rdar://96868333
2022-07-18 13:20:20 -07:00
Ben Barham
4dfaa820ac [rebranch] Remove now unused function 2022-07-08 10:17:16 -07:00
swift-ci
5c8f1fcb12 Merge remote-tracking branch 'origin/main' into rebranch 2022-07-02 17:03:37 -07:00
Michael Gottesman
198b974622 Merge pull request #59859 from gottesmm/pr-276c4e4220a25490659a285e8b94a36bd28ffede
[no-implicit-copy] Rename SILMoveOnlyType -> SILMoveOnlyWrappedType.
2022-07-01 23:17:43 -07:00
Michael Gottesman
8f3fe63fed [no-implicit-copy] Rename SILMoveOnlyType -> SILMoveOnlyWrappedType.
Since I am beginning to prepare for adding real move only types to the language,
I am renaming everything that has to do with copyable types "move only wrapped"
values instead of move only. The hope is this reduces/prevents any confusion in
between the two.
2022-07-01 17:26:13 -07:00
swift-ci
31af44324e Merge remote-tracking branch 'origin/main' into rebranch 2022-06-30 00:14:54 -07:00
Pavel Yaskevich
b2b1efd268 [Distributed] Decl: Add a new distributed-thunk bit
The flag is used to distinguish between regular functions/accessors
and synthesized distributed thunks.
2022-06-29 14:49:10 -07:00
swift-ci
55000f53be Merge remote-tracking branch 'origin/main' into rebranch 2022-06-17 10:15:14 -07:00
Becca Royal-Gordon
9b5f89963b [NFC] Serialize ObjC selectors for protocols
The ObjCMethodLookupTable for protocols was not being serialized and rebuilt on load, so NominalTypeDecl::lookupDirect() on selectors was not working correctly for deserialized types. Correct this oversight.
2022-06-16 14:07:49 -07:00
swift-ci
11797556b7 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-14 21:34:11 -07:00
Doug Gregor
25a7988982 Teach witness thunks to hop to the actor when needed.
When a synchronous, actor-isolated declaration witnesses an
asynchronous, not-similarly-isolated requirement, emit an actor hop
within the witness thunk to ensure that we properly enter the context
of the actor.

Fixes #58517 / rdar://92881539.
2022-06-14 16:45:28 -07:00
swift-ci
22dd6786a8 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-03 15:58:11 -07:00
Michael Gottesman
c66061a783 [moveOnly] Add a new SIL specific AST type called SILMoveOnly.
It can only be used in SIL contexts to express that a wrapped type is
MoveOnly.
2022-06-03 11:27:16 -07:00
swift-ci
75f7d2e957 Merge remote-tracking branch 'origin/main' into rebranch 2022-05-16 14:13:30 -07:00
Ben Barham
47721d25e6 Merge pull request #42394 from DavidGoldman/hermeticindexstore
Support hermetic indexing information + introduce `-file-prefix-map`
2022-05-16 14:09:25 -07:00
David Goldman
c232ed2913 Support hermetic indexing information
Swiftc port of https://github.com/apple/llvm-project/pull/4207.

This introduces a new flag, `-file-prefix-map` which can be used
instead of the existing `-debug-prefix-map` and `-coverage-prefix-map`
flags, and also remaps paths in index information currently.
2022-05-16 11:00:14 -04:00
Ben Barham
8148c763cd Merge pull request #58847 from bnbarham/rebranch-test-fixes
[next] Fixes for various test failures on rebranch
2022-05-12 09:30:39 -07:00
Ben Barham
427a689a96 [next] Convert const char * fields to StringRef
llvm/llvm-project d0262c2394f46bb7da2a75529413d625c70908e5 added a new
default bool param to the two constructors in `SmallVectorMemoryBuffer`.
Since `options.OutputPath` is a `const char *` and that can be promoted
to a `bool`, the constructor being called was changed to the first
constructor (with a default buffer name) - promotion is preferred over
conversion.

Convert the various output paths to a `StringRef` - all their uses
converted to `StringRef` anyway. Also specify the default parameter in
order to maintain the old behaviour, which didn't require a null
terminator.
2022-05-11 17:06:29 -07:00
Anton Korobeynikov
a1e138b2af [AutoDiff] Implement cross-file lookup of derivatives (#58644)
Look-up for functions with @derivative attributes defined in non-primary source files

Fixes #55170
2022-05-11 08:18:51 -07:00
Joe Groff
d2fad71328 Merge pull request #42589 from jckarter/begin-partial-apply-simplification-pass
[SIL] Initial work on PartialApplySimplification pass
2022-05-02 10:20:39 -07:00
Josh Soref
203b9ce33f Spelling serialization (#42515)
* spelling: absolute

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: ambiguous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: attempting

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: attrs

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dependency

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: extract

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: function

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: interface

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: mandatory

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: particular

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: related

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: signature

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: specifies

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: that

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: the

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: without

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-25 12:58:35 -07:00
Joe Groff
1e2bda9ea0 Extensions to SILBoxType to represent captures.
- Add a `[reflection]` bit to `alloc_box` instructions, to indicate that a box
  should be allocated with reflection metadata attached.
- Add a `@captures_generics` attribute to SILLayouts, to indicate a type layout
  that captures the generic arguments it's substituted with, meaning it can
  recreate the generic environment without additional ABI-level arguments, like
  a generic partial application can.
2022-04-21 12:51:46 -07:00
Luciano Almeida
9a1008809c [AST] Serialize bit async let info on AnyPattern 2022-04-17 14:06:39 -03:00
Slava Pestov
6982b90c6e Serialization: Round-trip primary associated type list 2022-04-16 22:36:29 -04:00
Pavel Yaskevich
cd17bee644 [Serialization] Opaque types: serialize conditionally available underlying types
Resolves: rdar://90595158
2022-04-04 12:45:20 -07:00
Slava Pestov
8c47cd75fd Sema: The primary associated type list references existing associated types instead of declaring new ones 2022-04-03 22:03:49 -04:00
Pavel Yaskevich
a5a50a3658 [AST] NFC: Rename underlying type accessors of OpaqueTypeDecl
Adds a `Unique` component to the accessor names to draw the
distinction between unique and conditionally available substitutions.
2022-03-28 16:22:08 -07:00
Alexis Laferrière
93e8a359e3 [Serialization] Ignore the exported module name for XRefs
Write the real module name for XRefs in swiftmodule files instead of the
exported module name, from `export_as` declarations in module maps.
Swiftmodule files are internal details now, they should represent the
truth.

We keep using the exported module name for the extensions lookup table
as clients should still use the exported name. However we may need to
write both alternatives in the lookup table in the future if extensions
can't be found from clients not importing the exported as module.

rdar://90272035
2022-03-23 12:38:59 -07:00
Evan Wilde
aa51bdf17a Add noasync availability kind to available attr
This patch adds the `noasync` availability kind to `@available`. The
spelling is `@available(*, noasync)`.
2022-03-22 15:12:51 -07:00
Ben Barham
41f176b7bf [Serialization] Abort if serializing CustomAttr with no type
Rather than crash when deserializing a CustomAttr with no type, crash
when serializing it instead (which is usually easier to diagnose).
2022-03-17 13:12:10 -07:00
Robert Widmann
e2f7d516e3 Register Parameterized Protocol Abbreviation 2022-03-08 22:00:38 -08:00
Robert Widmann
d6186c9cfb Add a DeclContext Parameter to Opened Archetype Construction
This ensures that opened archetypes always inherit any outer generic parameters from the context in which they reside. This matters because class bounds may bind generic parameters from these outer contexts, and without the outer context you can wind up with ill-formed generic environments like

<τ_0_0, where τ_0_0 : C<T>, τ_0_0 : P>

Where T is otherwise unbound because there is no entry for it among the generic parameters of the environment's associated generic signature.
2022-03-07 22:54:22 -08:00
Xi Ge
ce07ce2dbc frontend: add basic support for @_spi_available 2022-03-04 21:26:56 -08:00
John McCall
ec20619604 Merge pull request #41649 from rjmccall/centos-build-fix
Build fix for CentOS 7: somehow the default template argument isn't visible
2022-03-04 03:24:22 -05:00
John McCall
1b1e1a91cb Build fix for CentOS 7: somehow the default argument isn't visible.
I didn't mean to use the default argument anyway, so this is fine.
2022-03-03 14:06:49 -05:00
Slava Pestov
a013cd2076 AST: Replace PrimaryAssociatedTypeAttr with AssociatedTypeDecl::isPrimary() flag 2022-03-03 10:15:02 -05:00
John McCall
7830d937e0 Make room in the serialization decl block for more attributes. 2022-02-28 19:10:28 -05:00