Commit Graph

64 Commits

Author SHA1 Message Date
John McCall
3cfda35b7c Remove the unused swift_asyncLet_{start,end,wait,wait_throwing} runtime
functions.

These were introduced in an early draft implementation of async let, but
never used by a released compiler. They are not used as symbols by any
app binaries. There's no reason to keep carrying them.

While I'm at it, dramatically improve the documentation of the remaining
async let API functions.
2025-11-03 13:45:18 -08:00
Ian Anderson
cb954b98f9 [ABIChecker] Use -Isystem and -Fsystem for swift-api-digester
Use the Swift -Fsystem flag for swift-api-digester instead of the clang -iframework flag. Add support for -Isystem for parity.

rdar://152747420
2025-06-18 21:21:45 -07:00
Hamish Knight
289092b9ec [api-digester] Avoid modeling ParenType
This isn't a useful node to record.
2024-10-24 15:13:06 +01:00
Alexander Cyon
4a2942bb4e Fix typos in: cmake, tools, utils, unittests, validation-test
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
2024-07-12 02:34:00 +03:00
Daniel Rodríguez Troitiño
42e43edef3 [cmake] Unify usage of create_symlink/copy across the build files. (#72202)
In several places, there was the same or similar code to either do
a symlink or use copy/copy_if_different/copy_directory in Windows
systems. The checks were also slightly different in some cases.

There is a `SWIFT_COPY_OR_SYMLINK` that can be controlled as a CMake
option, and uses `CMAKE_HOST_UNIX` as default. Change all cases that
I can find to use that value. Also create a parallel value
`SWIFT_COPY_OR_SYMLINK_DIR` to apply to directories.

There is still a couple of cases that are specific to macOS SourceKit
framework which I have left as-is, since symlinks is probably the only
right thing to do there.

There's a case for Windows specifically that uses symlinks (in
523f807694/cmake/modules/SwiftConfigureSDK.cmake (L502))
which I have not modified as well.
2024-03-09 18:03:55 -08:00
Jeremy Schonfeld
2404013f78 [SE-0270] Add Collection Operations on Noncontiguous Elements (#69766)
* Adds RangeSet/DiscontiguousSlice to the stdlib

* Remove redundant DiscontiguousSlice.Index: Comparable conformance

* Attempt to fix embedded build

* Attempt to fix macOS test failures

* Fix Constaints/members.swift failure on linux

* Add exceptions to ABI/source checker to fix macOS tests

* Fix incremental dependency test failure

* Remove inlining/unfreeze implementation for future improvements

* Simplify indices(where:) implementation

* Address review feedback

* Add test for underscored, public slice members

* Address feedback on inlining, hashing, and initializing with unordered arrays

* Fix ABI checker issues

* Remove MutableCollection extension for DiscontiguousSlice

* Make insertion return a discardable Bool

* Fix ABI checker tests

* Fix other ABI checker tests due to dropping MutableCollection subscript
2024-01-09 14:02:19 -08:00
Stéphan Kochen
7b460ce495 build: fix accidental cmake expansions
As of CMake 3.25, there are now global variables `LINUX=1`, `ANDROID=1`,
etc. These conflict with expressions that used these names as unquoted
strings in positions where CMake accepts 'variable|string', for example:

- `if(sdk STREQUAL LINUX)` would fail, because `LINUX` is now defined and
  expands to 1, where it would previously coerce to a string.

- `if(${sdk} STREQUAL "LINUX")` would fail if `sdk=LINUX`, because the
  left-hand side expands twice.

In this patch, I looked for a number of patterns to fix up, sometimes a
little defensively:

- Quoted right-hand side of `STREQUAL` where I was confident it was
  intended to be a string literal.

- Removed manual variable expansion on left-hand side of `STREQUAL`,
  `MATCHES` and `IN_LIST` where I was confident it was unintended.

Fixes #65028.
2023-07-17 21:50:50 +02:00
Anthony Latsis
7f6d3bcd41 ASTPrinter: Turn on explicit any printing for everything and remove the option to disable it 2023-05-13 02:55:49 +03:00
Josh Soref
4611cafbca spelling: separately
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-09-15 19:43:37 -04:00
Rob Prentiss
ebe20a441c api_checker: Drop support for Python 2
This converts the `utils/api_checker` scripts to support Python 3 only.
It removes all `from __future__` imports, and switches any `python`
shebangs to `python3`.
2022-03-09 10:27:54 -08:00
Xi Ge
daab430ea3 test: rebaseline stable ABI for _Concurrency 2021-10-21 13:06:11 -07:00
Ben Barham
f4ab22e231 Update maccatalyst 13.0 target minimum to 13.1
Clang enforces a minimum 13.1 deployment target. The driver, API
checker, and various tests assume 13.0 is a valid minimum. Update these
to reflect the actual 13.1 minimum.

Resolves rdar://84177900
2021-10-16 13:24:45 +10:00
Doug Gregor
d8b2118cf4 Merge pull request #39668 from DougGregor/concurrency-abi-permanence 2021-10-09 10:38:52 -07:00
Doug Gregor
4961220a2d Add ABI baseline and checking for _Concurrency library on macOS
Add the generated ABI baseline for the _Concurency model on x86_64
macOS, along with a test that checks the built _Concurrency model
against that baseline.

Right now, the test is a mess, because we have some ABI breaks to
unwind. Add it so the test passes, and then we'll audit and address
every change.

Fixes rdar://83673282.
2021-10-08 21:18:30 -07:00
Mishal Shah
828412bd22 Update the python version to python3 for swift-api-checker.py 2021-10-06 09:11:17 -07:00
Daniel Rodríguez Troitiño
970c030d19 [cmake] Rename swift-api-digester to its new name. (#37937)
In #36381 the swift-api-digester changed from being a standalone tool to
be a symlink of the frontend. With the symlink, the target
swift-api-checker disappeared. In order to keep depending on
symlink_abi_checker_data for the tests, change the mentions of
swift-api-checker to swift-frontend (which is the actual target that
creates the symlink).
2021-06-16 15:07:10 -07:00
Argyrios Kyrtzidis
0701eb7d4c [utils/api_checker] Adjust the script for inferring imports from an SDK and add a couple of utility scripts 2020-08-17 18:31:40 -07:00
Meghana Gupta
b34791a0a0 Update code as per Apple Style Guide
whitelist -> allowlist
blacklist -> denylist
2020-07-24 11:37:15 -07:00
tbkka
868425be8a More Python3 lint fixes (#32967)
* More Python3 lint fixes

Some of the issues addressed include:
* Don't use `l` as a variable name (confusable with `1` or `I`)
* `print` statement does not exist in Py3, use `print` function instead
* Implicit tuple deconstruction in function args is no longer supported,
  use explicit splat `*` at the call site instead
* `xrange` does not exist in Py3, use `range` instead

* Better name per review feedback
2020-07-19 21:44:13 -07:00
Xi Ge
e937184b99 swift-api-checker.py: add framework search path for XCTest 2020-04-03 16:32:00 -07:00
Xi Ge
419b14772c swift-api-checker.py: add -swift-only flag when checking ABI stability
The existing logic of ABI checking only works for Swift symbols. We need to
add this flag so the script can work with Swift overlays.

rdar://60786484
2020-04-03 16:24:05 -07:00
Xi Ge
0aea09fa14 ABI checker: remove assert-only decls from the generated stdlib ABI baseline
rdar://59772479
2020-03-02 14:01:53 -08:00
Xi Ge
71a73a9551 test: update ABI/API baselines for stdlib 2020-02-24 12:23:24 -08:00
Jordan Rose
998d2ed739 [CMake] Include API checker nil baseline even when not building all (#27098) 2019-09-10 09:26:26 -07:00
Xi Ge
75b3dfb865 cmake: using PROGRAMS instead of providing permission bits for swift-api-checker.py 2019-09-06 17:14:49 -07:00
Xi Ge
1d5aaa8509 cmake: ensure swift-api-dhecker.py is executable in the toolchain 2019-09-06 14:52:29 -07:00
Xi Ge
d8b611d060 ABI/API checker: teach the tool to diagnose against a builtin empty baseline
Framework authors may be interested in comparing the current framework build
against an empty baseline to find public APIs without @available attributes. This
change makes such exercise easier.
2019-09-04 11:07:39 -07:00
Xi Ge
115569f0de swift-api-checker.py: introduce a sub directory under framework name for ABI baselines
In case we need to also include framework API baselines in the future, we should have
an additional layer of directory for ABI baseline files.
2019-09-03 10:50:13 -07:00
Xi Ge
cc6a246deb Revert "Revert "swift-api-digester: teach the tool to find framework-specific baselines from relative path"" 2019-09-01 09:19:43 -07:00
eeckstein
63a3cee0bf Revert "swift-api-digester: teach the tool to find framework-specific baselines from relative path" 2019-09-01 09:51:06 +02:00
Xi Ge
178e5d5ecf swift-api-digester: teach the tool to find framework-specific baselines from relative path
The framework baselines are installed at 'lib/swift/FrameworkABIBaseline' and the
tool is inside 'bin'. This patch teaches the executable to locate baselines
from the relative path.

In addition, this patch moves the stdlib ABI/API baselines to the canonical
location so we don't have to check the stability of the stdlib using a
different mechanism from other Swift frameworks.
2019-08-30 23:14:03 -07:00
Xi Ge
4f7ade9e8a cmake: symlink framework ABI baseline data into the build directory
When running the ABI checker from the build artifact, the executable
should be able to find baselines in the same relative paths as if
it's running from a toolchain.
2019-08-30 14:44:15 -07:00
Xi Ge
d09329676b swift-api-checker.py: teach the script to generate target-specific baseline for a single module
This allows us to generate baselines for the Swift stdlib using an Xcode release.
2019-08-30 12:42:10 -07:00
Xi Ge
cdd4eed3ea swift-api-checker.py: remove unnecessary framework search paths 2019-08-26 11:30:53 -07:00
Xi Ge
eab0c55b16 swift-api-checker.py: allow users to specify json file names when dumping framework content 2019-08-26 10:57:58 -07:00
Xi Ge
6e45f89381 cmake: set up installing framework ABI baselines into toolchain 2019-08-22 17:00:29 -07:00
Xi Ge
1857a37e3b Merge pull request #26773 from nkcsgexi/abort-compiler-error
ABI/API checker: abort after error occurs while importing a module
2019-08-21 19:01:55 -07:00
Xi Ge
d4bfae8595 ABI/API checker: abort after error occurs while importing a module 2019-08-21 15:57:39 -07:00
Xi Ge
7a19538cb0 swift-api-checker: pass down --catalyst to infer-imports.py when looking for them 2019-08-21 11:48:10 -07:00
Xi Ge
6562fa47a3 Merge pull request #26748 from nkcsgexi/fixed-modules-swift
swift-api-checker: rename existing fixed-module lists to fixed-clang-modules
2019-08-20 16:25:54 -07:00
Xi Ge
362ece8445 swift-api-checker: add support for invoking low-level executable using iosmac target 2019-08-20 15:39:09 -07:00
Xi Ge
d388bac43a swift-api-checker: rename existing fixed-module lists to fixed-clang-modules
This patch also adds fixed-swift-modules to hard-code CreateML, which could
not be found in the regular framework search path.
2019-08-20 12:19:46 -07:00
Xi Ge
756be16664 swift-api-checker: teach infer-imports to find all catalyst-supporting Swift frameworks 2019-08-20 10:51:30 -07:00
Xi Ge
3914452ecf Revert "Revert "swift-api-checker: update target triples for the tool to use"" 2019-08-01 11:48:27 -07:00
Mishal Shah
f4f3113d38 Revert "swift-api-checker: update target triples for the tool to use" 2019-08-01 11:10:31 -07:00
Xi Ge
79554093a4 swift-api-checker: update target triples for the tool to use 2019-07-31 18:13:48 -07:00
Xi Ge
2908c491f6 swift-api-checker: teach the script to collect all frameworks with Swift overlay in SDKs 2019-07-08 13:14:07 -07:00
Xi Ge
5d906e643a swift-api-checker: teach the script to dump entire SDK content to files separated by modules 2019-07-03 12:56:19 -07:00
Xi Ge
4ac14ea0d5 swift-api-checker: print framework names when diagnosing breakages 2019-06-17 16:19:40 -07:00
Xi Ge
06c958e6af swift-api-checker: teach the script to collect Swift only frameworks from the SDK.
This will only include frameworks like SwiftUI, Combine, etc.

Related: rdar://48456712
2019-06-13 12:36:56 -07:00