Richard Wei
94e8f5393e
Enable string processing by default.
...
Make frontend flag `-enable-experimental-string-processing` default to true.
2022-06-12 20:25:16 -07:00
Slava Pestov
beec309c9d
AST: Fix debug info mangling of opaque result types with @_originallyDefinedIn
...
If a function's parameter or return types involve nominal types that
have been moved across modules using @_originallyDefinedIn, we must
take care to always mangle the opaque result type's name using the
original module names and not the current module names.
This was a problem with DWARF mangling, which normally disables
@_originallyDefinedIn for other purposes. Make sure to always
temporarily re-enable it when mangling an opaque result type.
Fixes rdar://problem/93822207.
2022-06-02 18:15:31 -04:00
Allan Shortlidge
7b1d4df8bc
ModuleInterface: Fix decl attribute corruption in private swiftinterfaces
...
Erroneous declaration attributes were sometimes being printed in the private swiftinterfaces of modules because the changes from https://github.com/apple/swift/pull/42276 were effectively corrupting the attribute list for any decl with sythesized conformances (e.g. `Equatable`, `Hashable`). It is necessary to clone the attributes before adding them to the synthesized conformance extension decls.
Resolves rdar://94009296
2022-05-31 08:24:49 -07:00
Allan Shortlidge
5326cb031f
Tests: Adjust the swift-module-flags of the SilencePreconcurrency.swiftinterface test case to avoid over-specifying a target with a specific arch. This test currently fails when the locally built compiler lacks x86_64 support.
2022-05-27 10:43:55 -07:00
Ben Barham
efc9469444
Merge pull request #58975 from bnbarham/make-features-consistent
...
[Tests] Make OS features consistent
2022-05-25 16:02:43 -07:00
Holly Borla
e9c14cd88b
[ASTPrinter] Print the desugared constraint type following the 'any'
...
keyword.
2022-05-23 19:43:51 -07:00
Ben Barham
c163e0fe5e
[Tests] Make OS features consistent
...
lit.py currently allows any substring of `target_triple` to be used as a
feature in REQUIRES/UNSUPPORTED/XFAIL. This results in various forms of
the OS spread across the tests and is also somewhat confusing since they
aren't actually listed in the available features.
Modify all OS-related features to use the `OS=` version that Swift adds
instead. We can later remove `config.target_triple` so that these don't
the non-OS versions don't work in the first place.
2022-05-20 19:51:23 -07:00
Allan Shortlidge
7c9a626171
Merge pull request #58801 from tshortli/accept-existential-without-any-in-swiftinterfaces
2022-05-11 00:24:46 -07:00
Arnold Schwaighofer
e3b715bc2a
Merge pull request #58760 from aschwaighofer/swiftinterface_print_specialize_with_targetFunction
...
swiftinterface: print _specialize functions with targetFunction parameter in .swiftinterface
2022-05-10 19:45:30 -07:00
Allan Shortlidge
60146b32b4
Sema: Accept existentials without any in swiftinterfaces.
...
Resolves rdar://93052306
2022-05-10 17:43:05 -07:00
Slava Pestov
dac8d666ee
Stop passing -requirement-machine-{abstract,inferred,protocol}-signatures flags in tests
...
These flags are now no-ops.
2022-05-10 12:56:17 -04:00
Allan Shortlidge
e0e748c35a
ModuleInterface: Print existential any in swiftinterfaces since any is required for protocols with associated types in 5.7.
...
Resolves rdar://92976269
2022-05-09 14:10:07 -07:00
Arnold Schwaighofer
7bfa01a817
swiftinterface: print _specialize functions with targetFunction parameter in .swiftinterface
...
If we have an internal function with a `_specialize` attribute that has
a `targetFunction:` parameter we want the function to appear in the
.swiftinterface file such that the exported specialization can be picked up by
the compiler.
2022-05-09 10:08:52 -07:00
Josh Soref
760343f478
Spelling test moduleinterface ( #58579 )
...
* spelling: because
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: flaky
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: the
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com >
2022-05-05 16:58:25 -07:00
Alexis Laferrière
c93a4a466b
Merge pull request #42486 from xymus/ignore-adjacent-public-swiftmodule
...
[ModuleInterface] Ignore adjacent swiftmodules under the Frameworks folder
2022-04-25 09:17:42 -07:00
Alexis Laferrière
3aebf2850d
[ModuleInterface] Ignore adjacent swiftmodules from the Frameworks folder
...
Always use the swiftinterfaces of modules under the public Frameworks
folder in the SDK. Distributed swiftmodules are unreliable, they should
only be used as a local cache. Let's avoid them when possible.
rdar://92037292
2022-04-20 10:44:21 -07:00
Allan Shortlidge
a074d1e938
NFC: Add a test that exercises subclassing an Obj-C subclass of NSObject and verifies the printed members of the Swift subclass when emitting a module interface for a module containing the Swift subclass. Also verifies that NS_SWIFT_UNAVAILABLE initializers are omitted from the emitted interface.
2022-04-19 21:32:33 -07:00
Allan Shortlidge
826cc9d0c1
Sema: Avoid requiring properties to have initializers in @requires_stored_property_inits classes when type checking module interfaces. Most initializers are not printed in interfaces so enforcing this requirement in that context doesn't make sense.
...
Resolves rdar://91505142
2022-04-18 09:12:35 -07:00
Allan Shortlidge
1a600f4a79
Merge pull request #42351 from tshortli/adopt-interface-verification-in-more-tests
...
ModuleInterface: Enable interface verification in more tests
2022-04-18 09:12:03 -07:00
Allan Shortlidge
747f286b8d
ModuleInterface: Adopt new swiftinterface verification lit substitutions pervasively in tests where they can be adopted by simply updating or adding a few RUN: lines.
2022-04-15 20:13:00 -07:00
Allan Shortlidge
922af42afd
ModuleInterface: Adopt swiftinterface verification lit substitutions in synthesized.swift. Update the test to expect output for a resilient framework by removing @inlinable attributes from a few decls.
2022-04-15 20:12:59 -07:00
Allan Shortlidge
fa94c20abb
ModuleInterface: Adopt swiftinterface verification lit substitutions in preserve-type-repr.swift. The test was originally written assuming that CHECK: lines are always matched by FileCheck even when alternate prefixes are specified via --check-prefix, so it contained some incorrect expectations that needed to be updated.
2022-04-15 20:12:59 -07:00
Allan Shortlidge
f40f0b029b
ModuleInterface: Adopt swiftinterface verification lit substitutions in access-filter.swift. Fix an error caused by conforming to a @usableFromInline protocol using a non-UFI member (this was diagnosed as a warning in Swift 4 and became an error in Swift 5). Also, remove @_hasInitialValue from the expted swiftinterface contents since that attribute isn't emitted for types in resilient modules.
2022-04-15 20:12:59 -07:00
Allan Shortlidge
e10ebcab08
ModuleInterface: Adopt swiftinterface verification lit substitutions in emit-interface-macos-canonical-version.swift. Move the test to the ModuleInterface directory to colocate it with other swiftinterface generation tests and rename it to availability-macos-canonical-version.swift. Remove an extraneous -experimental-skip-non-inlinable-function-bodies flag that seemed like it was copypasta.
2022-04-15 20:12:59 -07:00
Allan Shortlidge
aeafcf8b0f
ModuleInterface: Adopt swiftinterface verification lit substitutions in available-attr-no-collapse.swift. Also, put the input file contents directly in the test file instead of RUN: echo lines to make the test a bit easier to understand.
2022-04-15 20:12:59 -07:00
Allan Shortlidge
ab9bff389b
ModuleInterface: Adopt swiftinterface verification lit substitutions in escape-Type-and-Protocol.swift. Update the test to no longer expect @_hasInitialValue to be emitted since that attribute is intentionally dropped from interfaces when -enable-library-evolution is specified.
2022-04-15 20:12:59 -07:00
Allan Shortlidge
bdd08ac654
ModuleInterface: Adopt swiftinterface verification lit substitutions in inherited-generic-parameters.swift. This revealed that function decls without explicit parameter names can be printed into swiftinterfaces with duplicate synthesized names so update the test to avoid that bug.
2022-04-15 20:12:59 -07:00
Allan Shortlidge
83ed2dc5d1
ModuleInterface: Adopt swiftinterface verification lit substitutions in skip-override-keyword.swift and skip-override-spi.swift. Add CHECK lines to these tests to make their expectations a bit more explicit.
2022-04-15 20:12:59 -07:00
Allan Shortlidge
454689a399
ModuleInterface: Adopt swiftinterface verification lit substitutions in back-deploy-attr.swift. Simplify the test now that another test exercises deserialization of the attribute from a module.
2022-04-15 15:50:59 -07:00
Doug Gregor
9de1a79511
Merge pull request #42362 from DougGregor/preconcurrency-silence-swiftinterface
2022-04-14 21:14:00 -07:00
Doug Gregor
aad67a828b
Only run this new test on macOS
2022-04-14 17:25:48 -07:00
Allan Shortlidge
d3dbe75419
ModuleInterface: Introduce the %target-swift-emit-module-interface and %target-swift-typecheck-module-from-interface lit substitutions and adopt them in some tests that involve emitting a swiftinterface. The substitutions specify the additional flags -swift-version 5 -enable-library-evolution. There are a few motivations for adding these substitutions:
...
- Tests that depend on emitted interfaces should generally use flags that are typical for modules that have textual interfaces (e.g. `-enable-library-evolution`).
- If a test is intended to produce a valid `swiftinterface` then it should verify that interface. This will help prevent interface printing regressions caused by compiler changes.
- Having commonly used substitutions for tests that emit interfaces makes it easy to experiment with compiler flags that might effect interface printing.
Resolves rdar://91634358
2022-04-14 15:09:36 -07:00
Allan Shortlidge
cc0627a8cb
Merge pull request #42276 from tshortli/global-actor-broken-swift-interface
...
ModuleInterface: Wrap synthesized extensions in swiftinterfaces with feature guards
2022-04-14 15:08:11 -07:00
Doug Gregor
8cef6d5572
Don't emit @preconcurrency import warnings for Swift interfaces
...
Fixes rdar://88758592.
2022-04-13 23:19:50 -07:00
Daniel Duan
3dfc40898c
[NFC] Remove Python 2 imports from __future__ ( #42086 )
...
The `__future__` we relied on is now, where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html ):
* absolute_import
* print_function
* unicode_literals
* division
These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
Allan Shortlidge
f27005b8d0
ModuleInterface: When printing synthesized extensions, we need to be sure to guard them with required features if applicable. Not doing so can result in broken interfaces that do not typecheck because, for instance, a conformance can refer to a nominal type that is only declared when certain features are enabled.
...
Also, fix a typo where `#elsif` was printed into interfaces instead of `#elseif`.
Resolves rdar://91509673
2022-04-12 17:53:59 -07:00
Artem Chikin
b3726d097b
Merge pull request #42217 from artemcm/BareBonesRegexSyntax
...
Rename flag for enabling forward slash literals to be less ambiguous.
2022-04-11 16:40:23 -07:00
Slava Pestov
9a7df88bc8
ASTPrinter: Rename PrimaryAssociatedTypes feature to PrimaryAssociatedTypes2
...
There was a window where the PrimaryAssociatedTypes feature guarded the old
syntax; let's make sure we don't see breakage if a new standard library is
used with an old compiler.
2022-04-11 15:27:38 -04:00
Slava Pestov
b16498c3df
ASTPrinter: Remove printWithCompatibilityFeatureChecks() from printSynthesizedExtensionIfNeeded()
...
This path was not exercised in the test suite, and when the
PrimaryAssociatedTypes feature finally (incorrectly) triggered it,
it would print '#endifextension'.
2022-04-06 23:47:10 -04:00
Slava Pestov
1bf248e374
Enable parameterized protocols by default, and add new staging flag for parameterized existentials
2022-04-06 17:30:10 -04:00
Artem Chikin
7ba377b3c2
Rename flag for enabling forward slash literals to be less ambiguous.
...
Previous spelling could easily be mistaken for gating the entire feature.
Part of rdar://91119995
2022-04-06 09:46:40 -07:00
Xi Ge
6b1f736f16
Availability: only diagnose exposing SPI_AVAILABLE symbols in modules with library-level=API
...
For executable targets or private libraries, using SPI_AVAILABLE symbols should be allowed.
rdar://91088241
2022-04-04 15:33:30 -07:00
Slava Pestov
07e53c2b0f
Merge pull request #42158 from slavapestov/se-0346-revisions
...
Revise SE-0346 implementation for core team decision
2022-04-04 02:01:40 -04: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
Xi Ge
8dd638fbd0
ModuleInterface: ensure -disable-clang-spi flag to propagate to module interface builders
2022-04-02 21:31:00 -07:00
Artem Chikin
b04ae26391
Add support for -enable-regex-literals flag
...
- Add driver and frontend option
- Add LangOptions entry
- Ensure driver propagates flag to frontends
- Add feature to `features.json`
Part of rdar://91119995
2022-04-01 12:14:28 -07:00
Doug Gregor
5e50ee8560
Add @available attributes on the implicit "extension" for @_nonSendable types
...
`@_nonSendable` on a type effectively desugars to an unavailable
extension that provides (`@unchecked`) conformance to the `Sendable`
protocol. Make sure we copy over platform availability so that the
extension does not promise greater availability than the type it extends.
Fixes rdar://90330588.
2022-03-25 11:01:44 -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
Allan Shortlidge
59b62c2cc9
NFC: Update tests to include "before: " label in the @_backDeploy attribute.
2022-03-18 11:24:47 -07:00
Slava Pestov
305a1e42b6
RequirementMachine: Update some tests to pass with -requirement-machine-inferred-signatures=verify
2022-03-14 12:33:18 -04:00