Commit Graph

20496 Commits

Author SHA1 Message Date
Slava Pestov
d222470a0b AST: Remove unused methods from CaptureInfo 2024-04-18 22:47:23 -04:00
Ellie Shin
728aafab62 Update diagnostics def message 2024-04-18 16:51:24 -07:00
Ellie Shin
573d1b96ca Allow @frozen and @_fixed_layout for package access level.
Package decls were made to be resilient at the definition
site by default. By allowing the attributes to be applied
to package decls, we can enable non-resilient access.

Resolves rdar://125169361
2024-04-18 16:29:34 -07:00
Ellie Shin
0c0d8c0316 Merge branch 'main' into elsh/pkg-sil-verify 2024-04-18 13:34:29 -07:00
Anthony Latsis
7313b2f32c [NFC] Move a diagnostic from DiagnosticsParse.def to DiagnosticsSema.def 2024-04-18 23:07:14 +03:00
Anthony Latsis
9017bf77b1 Sema: Improve error messages for super in illegal context 2024-04-18 23:07:14 +03:00
Anthony Latsis
28de53f913 [NFC] Move a diagnostic from DiagnosticsCommon.def to DiagnosticsSema.def 2024-04-18 23:07:14 +03:00
nate-chandler
b00b5aad4f Merge pull request #72646 from nate-chandler/bitwise-copyable/20240327/1
[BitwiseCopyable] Allow suppression via ~.
2024-04-18 07:05:10 -07:00
Ellie Shin
45e8454a9e Merge branch 'main' into elsh/pkg-sil-verify 2024-04-17 22:46:55 -07:00
Meghana Gupta
2a9a78004c Merge pull request #73096 from meg-gupta/unsafeattr
Allow `@_unsafeNonescapableResult` on accessors
2024-04-17 22:37:53 -07:00
Ellie Shin
fbb3382e21 During Package CMO, SIL cloning happens during which
SILOptions::EnableSerializePackage info is lost.

SILVerifier needs this info to determine whether resilience
can be bypassed for decls serialized in a resiliently
built module when Package CMO optimization enabled.

This PR adds SerializePackageEnabled bit to Module format
and uses that in SILVerifier.

Resolves rdar://126157356
2024-04-17 22:37:48 -07:00
Meghana Gupta
2db6fe2ea7 Allow _unsafeNonescapableResult on accessors 2024-04-17 16:58:06 -07:00
Allan Shortlidge
0a2167c56c Merge pull request #73063 from tshortli/rename-extension-import-visibility-feature
Rename ExtensionImportVisibility to MemberImportVisibility and fix bugs
2024-04-17 14:57:01 -07:00
Meghana Gupta
bec666ca47 Merge pull request #73061 from meg-gupta/lifetimediagfixes
Diagnostic fixes to LifetimeDependence
2024-04-17 12:46:59 -07:00
Allan Shortlidge
eba581eec2 AST: Add appropriate attributes to module import fix-its.
Make sure suggested imports are consistent with imports in other files. Also,
make sure the underlying clang module is always imported `@_exported`.
2024-04-16 16:29:51 -07:00
Allan Shortlidge
bd59db6e15 AST: Refactor missing import diagnostic into standalone utility.
NFC.
2024-04-16 16:29:51 -07:00
Meghana Gupta
a05c34c72f Fix typos in diagnostics 2024-04-16 13:19:40 -07:00
Meghana Gupta
31b7a4e437 Move LifetimeDependence.cpp to AST 2024-04-16 12:05:23 -07:00
Pavel Yaskevich
7b8f76e3c4 Merge pull request #73007 from xedin/promote-dynamic-actor-isolation-to-upcoming-feature
[SE-0423] Promote `DynamicActorIsolation` to an upcoming feature and add a way to disable checks
2024-04-16 11:46:41 -07:00
Nate Chandler
eb1f0ac68a [BitwiseCopyable] Suppress via ~.
In addition to the existing language mechanism of
`@available(*, unavailable)`.
2024-04-15 16:46:24 -07:00
Nate Chandler
ba467d2bd2 [Sema] Enable suppression of inferred conformances.
Add the machinery to support suppression of inference of conformance to
protocols that would otherwise be derived automatically.

This commit does not enable any conformances to be suppressed.
2024-04-15 16:46:22 -07:00
Nate Chandler
9cece1b1e1 [NFC] AST: Define "repressible" known protocol.
This is the subset of suppressible protocols that are not invertible.
This commit doesn't add any such protocols.
2024-04-15 16:46:00 -07:00
Steven Wu
7a68d364f4 [Caching] Embed bridging header in binary module correctly when caching
When caching is enabled with include-tree, the bridging header PCH is
created from the include tree directly. Setup the rewriter correctly
when embedding the bridging header into swift binary module.

rdar://125719747
2024-04-15 14:46:38 -07:00
Artem Chikin
01d891ad99 Merge pull request #72834 from artemcm/UpstreamVisionOS
Introduce visionOS Platform
2024-04-15 09:33:49 -07:00
Pavel Yaskevich
3a0acf8043 [AST/Sema] Decouple @preconcurrency conformances from DynamicActorIsolation feature flag 2024-04-14 21:28:13 -07:00
Konrad `ktoso` Malawski
54229549b3 [Distributed] Offer fixit for import Distributed when it is required (#72948) 2024-04-12 18:05:32 -07:00
Joe Groff
7ff66fd023 Accept borrowing in pattern matches without underscore.
rdar://126305009
2024-04-11 18:06:08 -07:00
Artem Chikin
1f14158a1d Introduce VisionOS Platform
This change introduces a new compilation target platform to the Swift compiler - visionOS.

- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
2024-04-10 09:38:02 -07:00
Artem Chikin
f0d3ca8c3e Merge pull request #72932 from artemcm/UseClangStatCacheForScanningFS
[Dependency Scanning] Use a standalone `DependencyScanningFilesystem`on the scanner, sharing a common `status` cache from Clang's dependency service cache
2024-04-09 19:51:12 -07:00
Kavon Farvardin
179bc4b605 Merge pull request #72820 from kavon/conditional-copyable-restriction
NCGenerics: restrict conditional Copyable reqs
2024-04-09 17:56:34 -07:00
Kavon Farvardin
0ce97b8503 Diagnostics: noformat modifier for Type
Sometimes, quotes or an "aka" for a type are not desirable in a
diagnostic, such as one describing a Requirement. This modifier
suppresses such additional formatting a Type in a diagnostic.
2024-04-09 13:51:57 -07:00
Artem Chikin
1804a8486e [Dependency Scanning] Use a standalone DependencyScanningFilesystem on the scanner, sharing a common status cache from Clang's dependency service cache 2024-04-09 13:36:46 -07:00
Meghana Gupta
4b440a1d80 Merge pull request #72916 from meg-gupta/lifetimedepreq
Requestify LifetimeDependenceInfo
2024-04-09 11:28:18 -07:00
eeckstein
648705e524 Merge pull request #72850 from eeckstein/sensitive
Add the experimental attribute `@sensitive` for struct declarations
2024-04-09 15:46:22 +02:00
Erik Eckstein
ce33d47a4c stdlib: add the swift_clearSensitive runtime function 2024-04-09 12:01:10 +02:00
Erik Eckstein
a980452e59 Add the experimental attribute @sensitive for struct declarations
The attribute declares that a struct contains "sensitive" data.
It enforces that the contents of such a struct value is zeroed out at the end of its lifetime.
In other words: the content of such a value is not observable in memory after the value's lifetime.

Also add an experimental feature `Sensitive` with which the attribute can be enabled.
2024-04-09 12:01:10 +02:00
Konrad `ktoso` Malawski
7cd9063ba5 [Distributed] Diagnose missing import also for funcs in extensions
Resolves rdar://125813581
2024-04-09 17:08:27 +09:00
Meghana Gupta
afd2052e0b NFC: Reorganize LifetimeDependence utils 2024-04-08 22:33:32 -07:00
Meghana Gupta
c8c1f17821 Update lifetime dependence diagnostic message 2024-04-08 22:33:32 -07:00
Meghana Gupta
9c57458163 Fix index numbering in lifetime dependence 2024-04-08 22:33:28 -07:00
Meghana Gupta
e60e43cac1 Serialize inferred lifetime dependence info as well 2024-04-08 15:15:47 -07:00
Meghana Gupta
bfa6c57ac4 Requestify LifetimeDependenceInfo
Query and cache lifetime dependence info via evaluator requests
2024-04-08 15:15:36 -07:00
Michael Gottesman
8981f2dcc1 Merge pull request #72895 from gottesmm/pr-4dabe0ee6dfaea62f15e8c7eb725a6cc655e51c5
[region-isolation] Tweak the main transferring diagnostic.
2024-04-07 02:11:51 -07:00
Michael Gottesman
a56d0f5ded [region-isolation] Tweak the main transferring diagnostic.
Specifically, I am transforming it from "may cause a race" -> "may cause a data
race". Adding data is a small thing, but it adds a bunch of nice clarity.
2024-04-06 22:50:26 -07:00
Kuba (Brecka) Mracek
70afeef480 Merge pull request #70944 from kubamracek/volatile
Add experimental _Volatile module providing low-level primitives for MMIO
2024-04-05 23:42:27 -07:00
Steven Wu
109c85e00b Merge pull request #72291 from cachemeifyoucan/eng/PR-123711823
[ScanDependency] Move binary module validation into scanner
2024-04-05 15:53:53 -07:00
Kuba Mracek
7d44c2be48 [Volatile] Add a -enable-experimental-feature Volatile 2024-04-05 15:13:30 -07:00
Allan Shortlidge
a6aa2dc93f Merge pull request #72858 from tshortli/maccatalyst-unavailable-decl-stubs
AST: Fix a couple `_diagnoseUnavailableCodeReached()` crashes for zippered libraries
2024-04-05 09:35:04 -07:00
nate-chandler
d0ba8fdf46 Merge pull request #72856 from nate-chandler/rdar125934050
[BitwiseCopyable] Remove bespoke diagnostic.
2024-04-05 09:23:12 -07:00
Steven Wu
d4c90d6eeb [DependencyScanning] Handle testable dependencies correctly
Teach scanner to pick and choose binary modules correctly based on if it
is testable import or not. Some situations that scanner need to be
careful when testable is involved:

* When it is a regular import, it should not import binary modules that
  are built with -enable-testing, it should prefer interfaces if that is
  available.
* When testable import, it should only load binary module and it should
  make sure the internal imports from binary modules are actually
  required for testable import to work.

If a testable import only find a regular binary module, dependency
scanner currently will just preceed with such module and leave the
diagnostics to swift-frontend, because the alternative (failed to find
module) can be confusing to users.

rdar://125914165
2024-04-05 07:52:16 -07:00