Commit Graph

23 Commits

Author SHA1 Message Date
Allan Shortlidge
aef5e42457 Sema: Inherit SPI groups when synthesizing modify accessor.
Resolves rdar://108069565
2023-05-01 15:34:08 -07:00
Allan Shortlidge
2b0807d021 ModuleInterface: Avoid printing @_spi enum case decls in public swiftinterfaces.
rdar://72873771
2022-11-29 22:11:02 -08:00
Josh Soref
d4843a0ad2 spelling: method (#58564) 2022-05-27 22:06:54 -07:00
Varun Gandhi
02afb9d49b [ModuleInterface] Print full type if ambiguous for extensions.
The patch introduces a new setting instead of changing existing settings
because the generated interfaces in the IDE have slightly different
requirements; the extended type there is unconditionally not printed
qualified (even if it is ambiguous). This is likely because the
ambiguity heuristic is very weak; it doesn't even do name lookup.
Simplifying that logic would be nice, but then we'd need to update
a bunch of IDE/print* tests and end up with more more visual clutter
in the IDE.

Introducing the new setting means we can change the behavior for
swiftinterface files without affecting the behavior for IDE interfaces.

Fixes rdar://79093752.
2021-06-11 20:04:43 -07:00
Alexis Laferrière
758351110a [Sema] Allow the use of SPI in API for SPI modules
When the whole module has an SPI distribution, SPI declarations can be
used in API.

rdar://75335462
2021-04-20 15:02:51 -07:00
Doug Gregor
b5e4b085aa Infer ConcurrentValue conformances for structs and enums.
When a struct or enum has only ConcurrentValue-conforming instance
data, infer conformance to ConcurrentValue.
2021-03-02 00:23:33 -08:00
Arnold Schwaighofer
084db0d38f Revert "Merge pull request #34848 from aschwaighofer/make_prespecialization_experimental"
This reverts commit 3aec862e62, reversing
changes made to 158427bd5b.
2021-02-12 10:12:01 -08:00
Alexis Laferrière
c76269ec1a [ModuleInterface] Preserve SPI information for indirect conformances
rdar://73082943
2021-01-26 15:28:27 -08:00
Arnold Schwaighofer
8346bf7e90 Pre-specialization: This is an experimental feature
Only enable if explicitly required.
2020-11-20 09:13:16 -08:00
Arnold Schwaighofer
2a2cf91dcd Add support for marking a _specialize attribute as SPI
```
  @_specialize(exported: true, spi: SPIGroupName, where T == Int)
  public func myFunc() { }
```

The specialized entry point is only visible for modules that import
using `_spi(SPIGroupName) import ModuleDefiningMyFunc `.

rdar://64993425
2020-10-12 09:19:29 -07:00
Alexis Laferrière
357bf8fb3a [Sema] Test the interfaces generated by SPI/private_swiftinterface.swift 2020-09-16 11:20:59 -07:00
Alexis Laferrière
dac3922090 [Sema] Accept use of SPI in inlinable SPI declarations
rdar://63978500
rdar://63189125
2020-09-16 11:20:56 -07:00
Alexis Laferrière
fd78da5137 [ModuleInterface] Don't print extensions to implementation-only imported types
Extensions to implementation-only types are accepted at type-checking
only if they don't define any public members. However if they declared a
conformance to a public type they were also printed in the
swiftinterface, making it unparsable because of an unknown type.

Still accept such extensions but don't print them.

rdar://problem/67516588
2020-08-20 17:12:31 -07:00
Alexis Laferrière
930c8f2208 Merge pull request #32910 from xymus/spi-property-wrappers-storage
[Sema] SPI groups on a wrapped property propagates to the backing storage
2020-07-16 18:02:29 -07:00
Alexis Laferrière
47e4e29362 [Sema] SPI info on a wrapped property should propagate to the backing storage 2020-07-16 14:47:28 -07:00
Alexis Laferrière
4d2d0548e7 [ModuleInterface] Fix test for SPI attributes on unsupported decls 2020-07-10 08:42:19 -07:00
Alexis Laferrière
de2774799e Merge pull request #32211 from xymus/fix-invalid-spi-attr
[ModuleInterface] Don't print SPI attributes on unsupported decls
2020-07-09 13:04:15 -07:00
Hamish Knight
751e68177c [test] Remove uses of -sil-merge-partial-modules
Replace with -merge-modules, which means we can
also remove the now redundant
`-disable-diagnostic-passes` &
`-disable-sil-perf-optzns` options.
2020-07-01 23:14:50 -07:00
Alexis Laferrière
ead9bc3ce3 [ModuleInterface] Don't print SPI attributes on unsupported decls
When emitting the private swiftinterface, the compiler prints the
attribute explicitly even when it is deduced from the context. This can
lead to unparsable private swiftinterface files.

As a narrow fix, check if the decl type is supported before printing the
attribute.

rdar://64039069
2020-06-05 12:25:43 -07:00
Alexis Laferrière
8fefdece2c Use a SetVector when looking up the SPI attributes on imports
Using a SetVector fixes an issue where many source files imported the
same SPI group from the same module, the emitted private textual
interfaces superfluously repeated the `@_spi` attribute on the import.

rdar://problem/63681845
2020-05-27 16:11:12 -07:00
Alexis Laferrière
aa0f555cde No dummy constraint in the public swiftinterface for SPI extensions
rdar://problem/63352700
2020-05-19 13:13:59 -07:00
Alexis Laferrière
412469326d [SPI Test] Extend and update SPI tests 2020-03-04 16:43:05 -08:00
Alexis Laferrière
d4bd7220c7 [Test] Test generated private and public swiftinterface when using @_spi 2020-02-19 14:17:14 -08:00