Commit Graph

995 Commits

Author SHA1 Message Date
Allan Shortlidge
e49b248bee Frontend: Remove -disable-print-package-name-for-non-package-interface.
It is unsound to expose `package` declarations in textual interfaces without a
package identity for them to belong to so we should not offer this flag.

Resolves rdar://139361524.
2024-11-06 11:16:18 -08:00
Allan Shortlidge
b345418eca Merge pull request #77408 from tshortli/revert-package-fixes
Revert removal of `-package-name` from swiftinterfaces
2024-11-06 10:31:34 -08:00
Alex Hoppen
9a48cad432 Merge pull request #76939 from ahoppen/enable-parser-roundtrip
Enable experimental parser round-trip in test cases that no longer need it
2024-11-05 18:51:31 -08:00
Konrad `ktoso` Malawski
52d55a1426 Merge pull request #77364 from nickolas-pohilets/mpokhylets/non-experimental-isolated-deinit 2024-11-06 11:49:07 +09:00
Allan Shortlidge
49b59f69c9 Revert https://github.com/swiftlang/swift/pull/75745.
Finishes resolving rdar://139236053.
2024-11-05 14:37:56 -08:00
Allan Shortlidge
fa5b783e3f Revert https://github.com/swiftlang/swift/pull/76244.
Partially resolves rdar://139236053.
2024-11-05 14:13:39 -08:00
Artem Chikin
8e3a6207b9 Merge pull request #76915 from artemcm/AsyncScanExperiment
[Dependency Scanning] Parallelize Clang module queries
2024-11-05 10:04:31 -08:00
Mykola Pokhylets
c139d1b1a7 Make IsolatedDeinit non-experimental 2024-11-05 12:19:01 +01:00
Alex Hoppen
9bbdeaa8c0 Enable experimental parser round-trip in test cases that no longer need it
Also, track all remaining uses of `-disable-experimental-parser-round-trip` by issues.
2024-11-04 15:49:47 -08:00
Daniel Rodríguez Troitiño
ba68faaed5 [test] Mark tests that use experimental/upcoming features as such
Find all the usages of `--enable-experimental-feature` or
`--enable-upcoming-feature` in the tests and replace some of the
`REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which
should correctly apply to depending on the asserts/noasserts mode of the
toolchain for each feature.

Remove some comments that talked about enabling asserts since they don't
apply anymore (but I might had miss some).

All this was done with an automated script, so some formatting weirdness
might happen, but I hope I fixed most of those.

There might be some tests that were `REQUIRES: asserts` that might run
in `noasserts` toolchains now. This will normally be because their
feature went from experimental to upcoming/base and the tests were not
updated.
2024-11-02 11:46:46 -07:00
Steven Wu
8150fb001d [InterfaceFile] Improve flag extraction from interface file
Improve the version/flags extract from interface file by moving away
from using Regex and limiting the search to the beginning of the file.

Switch away from Regex will give 5-10% improvement in time and
instruction counts, and limiting the search lines can save a lot of time
if the swiftinterface is large. For example, the extract time for Swift
stdlib is 10x faster after the patch.

Current strategey for limiting the line to search is by only parsing the
first comment block.
2024-10-31 12:46:05 -07:00
Tony Allevato
97186b0738 Merge pull request #69460 from dylansturg/indexstore
Enable indexing for refs to implicit declarations.
2024-10-30 16:38:37 -04:00
Artem Chikin
0f50693aa5 [Dependency Scanning] Parallelize Clang module queries
This change refactors the top-level dependency scanning flow to follow the following procedure:

Scan():
1. From the source target under scan, query all imported module identifiers for a *Swift* module. Leave unresolved identifiers unresolved. Proceed transitively to build a *Swift* module dependency graph.
2. Take every unresolved import identifier in the graph from (1) and, assuming that it must be a Clang module, dispatch all of them to be queried in-parallel by the scanner's worker pool.
3. Resolve bridging header Clang module dpendencies
4. Resolve all Swift overlay dependencies, relying on all Clang modules collected in (2) and (3)
5. For the source target under scan, use all of the above discovered module dependencies to resolve all cross-import overlay dependencies
2024-10-30 11:10:10 -07:00
Pavel Yaskevich
84a62fc170 [Frontend/Serialization] Narrow -swift-compiler-version to -interface-compiler-version
It might be unexpected to future users that `-swift-compiler-version`
would produce a version aligned to .swiftinterface instead of one used
to build the .swiftmodule file. To avoid this possible confusion, let's
scope down the version to `-interface-compiler-version` flag and
`SWIFT_INTERFACE_COMPILER_VERSION` option in the module.
2024-10-28 13:45:27 -07:00
Dylan Sturgeon
a1e888785d Enable indexing for refs to synthesized declarations.
Based on feedback in PR https://github.com/swiftlang/swift/pull/69460, enabling indexing for synthesized decls because they are usable by users and make sense to appear in the indexstore.

Sets `synthesized` on some additional decls:

  - derived `hashInto(...)`
  - Objc properties and methods derived from Objc protocols

https://github.com/apple/swift/issues/67446
2024-10-28 10:07:27 -07:00
Pavel Yaskevich
83995f2ae0 [Frontend] Don't set "current" compiler version for modules built from swiftinterface
If swiftinterface doesn't have `-swift-compiler-version` flag
it means that it was generated with an older version of the
Swift compiler. In such cases it would be incorrect to use
"current" compiler version because the field is intended to
indicate the compiler the swiftinterface was built with.
2024-10-25 17:05:16 -07:00
Pavel Yaskevich
2d8751badf [Frontend] Always print current compiler version in swiftinterface flags
Swiftinterface files are always built with "current" compiler version,
which means that `-swift-compiler-version` has no effect in this context.
2024-10-25 09:53:47 -07:00
Pavel Yaskevich
ab4d8f61eb [Serialization] Add -swift-compiler-version option to swiftmodules 2024-10-25 09:53:40 -07:00
Allan Shortlidge
f827e7c6d3 Tests: Remove -disable-availability-checking in variadic generics tests. 2024-10-20 15:37:15 -07:00
Allan Shortlidge
6f55aa4170 Tests: Remove -disable-availability-checking in tests that use opaque types.
Use the `%target-swift-5.1-abi-triple` substitution to compile the tests for
deployment to the minimum OS versions required for use of opaque types, instead
of disabling availability checking.
2024-10-19 19:39:18 -07:00
Allan Shortlidge
cb578172ea Tests: Remove -disable-availability-checking in more tests that use concurrency.
Use the `%target-swift-5.1-abi-triple` substitution to compile the tests for
deployment to the minimum OS versions required for use of _Concurrency APIs,
instead of disabling availability checking.
2024-10-19 12:35:20 -07:00
Allan Shortlidge
082f0ac4b5 Tests: Use a more natural spelling for ABI triple lit substitutions.
`%target-swift-5.8-abi-triple` instead of `%target-swift-abi-5.8-triple`, for
example.
2024-10-18 10:11:36 -07:00
Steven Wu
1eab3b585b [ModuleCache] Prefer module cache passed on the command-line for checker
When setting up the ModuleInterfaceChecker, prefer using the module
cache path from command-line invocation `-module-cache-path` before
falling back to clang options.

Usually those two yield the same result, except for LLDB under direct
cc1 argument mode and explicit module build. Under such mode, the cc1
option for module cache path will be stripped since the output PCMs are
explicit passed as output. When LLDB attempted to do an implicit module
compilation for the swift interface, it will not be able to locate the
module cache path from cc1 arguments. On the other hand, the module
cache option has already be inherited by the sub-instance so it can just
directly be located there.

rdar://137610484
2024-10-16 09:14:47 -07:00
Richard Howell
3aed0950aa Merge pull request #76964 from rmaz/relres
Don't serialize relative resource dir paths in swiftmodules
2024-10-14 07:13:19 -07:00
Konrad `ktoso` Malawski
6f245bb8eb ABI comments: include stored property names 2024-10-11 08:01:43 +09:00
Richard Howell
7aa94723a6 Don't serialize relative resource dir module paths 2024-10-10 14:36:39 -07:00
Rintaro Ishizaki
ba485d4630 [Test] Disable experimental parser round-trip in '@lifetime' test cases
Until SwiftParser supports the syntax

rdar://137636751
2024-10-09 23:52:52 -07:00
Meghana Gupta
4df55a12cd Merge pull request #76834 from meg-gupta/lifetimedepmultiple
Replace dependsOn with @lifetime
2024-10-09 10:17:43 -07:00
Meghana Gupta
008431c3b4 Update some dependsOn tests to @lifetime 2024-10-08 15:12:13 -07:00
Allan Shortlidge
bbe3af61ce ModuleInterface: Avoid -disable-availability-checking in IsolatedDeinit test.
Instead, set the deployment target to the minimum necessary for concurrency
support.
2024-10-08 12:55:37 -07:00
Konrad `ktoso` Malawski
dea3b59331 Merge pull request #76250 from ktoso/wip-experimental-isolated-deinit 2024-10-03 17:19:10 +09:00
nate-chandler
43dce846bf Merge pull request #76778 from nate-chandler/general-coro/20240930/1
[Test] Add asserts req to experimental tests.
2024-09-30 11:06:35 -07:00
Richard Howell
c9b0a2a43f Merge pull request #76620 from rmaz/sdkprefix
Do not prefix relative SDK paths twice
2024-09-30 07:38:44 -07:00
Nate Chandler
6be4090e71 [Test] Add asserts req to experimental tests.
The CoroutineAccessors experimental feature requires asserts.
2024-09-30 07:09:49 -07:00
Konrad `ktoso` Malawski
45b97f146b Merge branch 'main' into wip-experimental-isolated-deinit 2024-09-30 13:47:39 +09:00
Richard Howell
a04ddefb10 Do not prefix relative SDK paths twice 2024-09-27 14:28:06 -07:00
Nate Chandler
091368ba21 [CoroutineAccessors] Added read.
The name is a placeholder for the mutating single-yield coroutine
accessor.
2024-09-26 18:10:39 -07:00
Nate Chandler
98a2e6a7df [CoroutineAccessors] Added modify.
The name is a placeholder for the mutating single-yield coroutine
accessor.
2024-09-26 18:10:39 -07:00
Doug Gregor
0aff85ced7 Emit mangled names for public symbols into the .swiftinterface
When the frontend option `-abi-comments-in-module-interface` is provided
during interface printing, the printed interface will contain
additional comments that provide the mangled names for public symbols.
This is an experiment in seeing how much information we can
meaningfully extract from a printed Swift interface for the purpose of
bridging with other languages.
2024-09-25 15:49:34 -07:00
Hamish Knight
8ba6a2ca1c Merge pull request #76640 from hamishknight/driver-parity
[test] Update tests for parity with the new driver
2024-09-24 13:46:38 +01:00
Allan Shortlidge
0fb36a5f39 AST: Make $SpecializeAttributeWithAvailability a baseline feature.
It has been available since at least Swift 5.8.
2024-09-23 21:48:09 -07:00
Hamish Knight
8e0407b8c1 [test] Add SWIFT_USE_OLD_DRIVER=1 to some tests
The behavior of these tests varies depending on
whether the new or old driver is being used, force
the old driver for now.
2024-09-22 23:10:40 +01:00
Hamish Knight
0869a3abd9 [test] Add -no-emit-module-separately to a couple of tests
A couple of tests are expecting merge-modules behaviour,
add `-no-emit-module-separately` in those cases to
ensure that merge modules is used in both the old
and new driver.
2024-09-22 21:15:45 +01:00
Konrad `ktoso` Malawski
d89347bed0 Merge branch 'main' into wip-experimental-isolated-deinit 2024-09-20 18:34:45 +09:00
Konrad `ktoso` Malawski
a6bc0e6759 temporary -experimental flag for IsolatedDeinit 2024-09-18 12:52:37 +09:00
Konrad `ktoso` Malawski
7d1ce789ad Revert "Revert "Isolated synchronous deinit"" 2024-09-17 17:35:38 +09:00
Meghana Gupta
0c3d10c8fa [NFC] Fix indentation on ModuleInterface/nonescapable_types.swift 2024-09-16 14:08:19 -07:00
Meghana Gupta
58c6a2fb31 Merge pull request #76455 from meg-gupta/enablestdlib
Enable NonEscapableTypes in standard library and make the feature suppressible
2024-09-16 11:52:41 -07:00
Meghana Gupta
68bfc0d3b4 Make NonEscapableTypes as a suppressible experimental feature 2024-09-13 13:13:17 -07:00
elsh
60f1ea4f85 Revert "Revert "Do not print package-name in non-package interface by default.""
This reverts commit 4b8e76fbeb.
2024-09-13 08:20:50 -07:00