Commit Graph

5698 Commits

Author SHA1 Message Date
Ben Langmuir
006e78e672 Merge pull request #37320 from fwcd/sourcekit-diagnostic-ids
[SourceKit] Add id and category to diagnostics
2021-05-17 14:25:40 -07:00
Artem Chikin
5ba154e2d1 [Build Script] Pass down cross compilation host targets to swift-driver build 2021-05-14 16:41:03 -07:00
Alex Hoppen
bf4a4af82a Merge pull request #37382 from kimdv/kimdv/fix-wrong-child-syntax-kind
[SwiftSyntax]: Use check for suffix instead of contains when checking for token
2021-05-14 19:23:16 +02:00
Ben Barham
762337cc9b [Refactoring] Add @completionHandlerAsync to sync function
When adding an async alternative, add the @completionHandlerAsync
attribute to the sync function. Check for this attribute in addition to
the name check, ie. convert a call if the callee has either
@completionHandlerAsync or a name that is completion-handler-like name.

The addition of the attribute is currently gated behind the experimental
concurrency flag.

Resolves rdar://77486504
2021-05-14 20:19:02 +10:00
Eric Miotto
c3f8dacdf0 [Build] allow to generate symbols for a subset of binaries (#37120)
This would be needed to reduce overall build times in scenarios when
generating symbols for all binaries is too expensive and/or not needed.

At the same time, introduce tests around the logic that handles symbols.

Addresses rdar://76865276
2021-05-13 07:32:41 -07:00
Mishal Shah
d9e5895941 Merge pull request #37390 from apple/shahmishal/update-checkout-scheme-concurrency-5.5-abi-2
Add scheme for concurrency-5.5-abi-2
2021-05-12 16:56:37 -07:00
Mishal Shah
6ea3163971 Add scheme for concurrency-5.5-abi-2 2021-05-12 13:09:02 -07:00
Eric Miotto
1e5f790d06 [Build] allow to generate symbols for a subset of binaries
This would be needed to reduce overall build times in scenarios when
generating symbols for all binaries is too expensive and/or not needed.

Addresses rdar://76865276
2021-05-12 10:02:41 -07:00
Eric Miotto
b903a6cc65 Put symbol generation logic under test
...before adding the logic to filter paths

In particular:
* print the list of files that `cpio` copies, so we can test explicitly
  which files end up in the symroot (and also see those when asking for
  a toolchain in PR testing)
* use `find` instead of `grep` to filter files we want symbols generated
  for -- this is to avoid the script failing when there are no symbol to
  process, especially in lit tests
* remove an unnecessary check for `swift-api-digester` -- this is now a
  symlink to `swift-frontend` and we only process regular files.

Supports rdar://76865276
2021-05-12 09:52:30 -07:00
Kim de Vos
779365cca2 [SwiftSyntax]: Use check for suffix instead of contains when checking for token
Syntax kind should end with token not contain it before it is considered as a token
2021-05-12 12:45:45 +02:00
Mishal Shah
ceac50eab1 Revert "Bump swift-argument-parser" 2021-05-11 12:42:45 -07:00
Andrew Trick
9537b14404 Fix refactor-check-compiles.py for python3
Fixes:
    sys.stdout.write(dump_text_output)
TypeError: write() argument must be str, not bytes
2021-05-10 20:50:18 -07:00
Miguel Perez
eb3ffb5a2e Bump swift-argument-parser 2021-05-10 19:22:59 -04:00
Andrew Trick
f0aa4db1a9 Merge pull request #37199 from atrick/viewcfg-py3
Fix viewcfg for python3
2021-05-10 15:10:26 -07:00
fwcd
71a34ff428 Represent diagnostic categories as UIDs in SourceKit (WIP) 2021-05-10 20:38:00 +02:00
Mishal Shah
152ff875b0 Add --time-tests flag to Windows build script 2021-05-07 10:08:38 -07:00
Artem Chikin
6f44ba4ff1 Merge pull request #37122 from artemcm/BringBackNewDriver
Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
2021-05-07 09:42:38 -07:00
fwcd
f6ba1314d0 Add ID field to SourceKit's diagnostics 2021-05-07 17:45:21 +02:00
Max Desiatov
7be99e4cbf Merge pull request #37084 from kateinoigakukun/katei/share-fatalerror-concurrency
Rename duplicated `swift::fatalError` in `swiftRuntime` and `swift_Concurrency`.

Both `swiftRuntime` and `swift_Concurrency` had `swift::fatalError` implementation, but it causes symbol conflict with the `-static-stdlib` flag.

This patch removes one of the implementations in `swift_Concurrency` to avoid conflicts. Also added a test case to ensure that linking the Concurrency module with `-static-stdlib` works.

This issue was found by SwiftWasm test cases.
2021-05-06 09:46:15 +01:00
Alex Hoppen
98e6680c85 [Refactoring] When adding an async alternative refactor the old method to call the async method using detach
Instead of leaving two copies of the same implementation, rewrite the old method with the completion handler to call the newly added `async` method.

Resolves rdar://74464833
2021-05-04 12:06:27 +02:00
Alex Hoppen
9916a6d5c7 [Refactoring] Add a drop-in replacement for swift-refactor which checks that the code compiles after refactoring 2021-04-30 23:48:23 +02:00
Luciano Almeida
83ac07f264 [build-script] Allow new Xcode 12.5 official release version 2021-04-29 23:27:09 -03:00
Rintaro Ishizaki
f6125c0003 Merge pull request #35097 from rintaro/parse-ifconfig-postfixexpr
SE-0308: Postfix '#if' expression
2021-04-29 16:10:17 -07:00
Miguel A. Perez Ojito
dfec9e6434 Merge pull request #37113 from apple/shahmishal/update-checkout-swift-argument-parser-0.4.3
Update the swift-argument-parser for main and next branch to 0.4.3
2021-04-29 14:07:20 -04:00
Rintaro Ishizaki
ce87bf7537 [Parse] Postfix '#if' expression
Implement postfix ifconfig expression which expands '#if' functionality
to postfix member reference expressions.

rdar://problem/51690082
2021-04-29 09:12:23 -07:00
Artem Chikin
ae2e856f9b Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
This reverts commit 937e1a365c, reversing
changes made to a5440a8abd.
2021-04-28 15:11:36 -07:00
Artem Chikin
1e44ed00eb Revert "Always build SwiftDriver and use it as default compiler driver" 2021-04-28 11:20:21 -07:00
Mishal Shah
8967cf9bff Update the swift-argument-parser for main and next branch to 0.4.3 2021-04-28 09:58:39 -07:00
Yuta Saito
1719148588 Add test case to ensure working static link with concurrency module 2021-04-28 23:52:11 +09:00
Artem Chikin
23452d5bad Merge pull request #36377 from artemcm/NewDriverDefault
Always build SwiftDriver and use it as default compiler driver
2021-04-27 09:53:06 -07:00
Artem Chikin
c2dc8e3d07 Always build (and use) the new SwiftDriver as the default compiler driver.
This will make sure that compiler developers are using the new driver when they build the compiler locally and use it.

- Adds a new build-script product category: before_build_script_impl for products we wish to build before the impl products.
- Adds a new EarlySwiftDriver product to that category, which gets built with the host toolchain.
- Adds an escape hatch: --skip-early-swift-driver
- Adjusts the swift CMake configuration with an additional step: swift_create_early_driver_symlinks which (if one was built) creates symlinks in the swift build bin directory to the EarlySwiftDriver swift-driver and swift-help executables.
- Adds a new test subset : only_early_swiftdriver, which will get built into a corresponding CMake test target: check-swift-only_early_swiftdriver-* which runs a small subset of driver-related tests against the Early SwiftDriver.
  - This subset is run always when the compiler itself is tested (--test is specified)
  - With an escape disable-switch: --skip-test-early-swift-driver
  - All tests outside of only_early_swiftdriver are forced to run using the legacy C++ driver (to ensure it gets tested, still).

NOTE: SwiftDriver product (no 'Early') is still the main product used to build the driver for toolchain installation into and for executing the product's own tests. This change does not affect that.
2021-04-26 12:17:32 -07:00
Andrew Trick
dc275dc8c7 Fix viewcfg for python3 2021-04-25 20:19:04 -07:00
Mishal Shah
3116eed2e4 Update the branch to build with Xcode 12.5 (#37046) 2021-04-23 16:24:11 -07:00
Mishal Shah
b5a01ba5e0 Support for x86_64 watchOS simulator
* Start testing watchOS simulator x86_64 and i386 by default

Users will require to install watchOS 6.2 or older simulator to support i386.

1. Install watchOS 6.2 or older simulator (Xcode -> Preferences -> Components -> Simulators).
2. Create a 32-bit watchOS device.
3. Run:
`xcrun simctl create 'Apple Watch Series 2 - 42mm' com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm com.apple.CoreSimulator.SimRuntime.watchOS-6-2`
2021-04-22 20:06:17 -07:00
Kim de Vos
a8fa3ba0eb Added helper variables and methods for SwiftSyntax gyb
https://github.com/apple/swift-syntax/pull/268
2021-04-21 13:03:23 +02:00
Robert Widmann
b65777eabe Merge pull request #36963 from CodaFi/arm64_32
Add arm64_32 support for Swift
2021-04-20 17:42:56 -07:00
Mishal Shah
1b099067bf Merge pull request #36324 from apple/add_build_script_log
Add build_script_log file to help us understand the build times for e…
2021-04-20 16:41:09 -07:00
Artem Chikin
0d2ea35d68 Merge pull request #36960 from artemcm/RecursiveLipoException
Add an option to `recursive-lipo` to explicitly specify files to be merged
2021-04-20 15:58:34 -07:00
Robert Widmann
0149ccd0ca Add arm64_32 support for Swift
Commit the platform definition and build script work necessary to
cross-compile for arm64_32.

arm64_32 is a variant of AARCH64 that supports an ILP32 architecture.
2021-04-20 14:59:04 -07:00
Robert Widmann
c8ba622532 Merge pull request #36875 from keith/ks/add-support-for-cross-compiling-from-apple-silicon-to-intel
Add support for cross compiling from Apple Silicon to Intel
2021-04-20 09:42:26 -07:00
Mishal Shah
f6d04a0f1a Don't create build_script_log file with --dry-run flag 2021-04-19 21:30:36 -07:00
Artem Chikin
792e3ddba7 Add an option to recursive-lipo to explicitly specify files to be merged, even if contained in verbatim-copy directories, and use it for libSwiftScan.
This library is contained in `lib/swift/<OS>/`, which `recursive-lipo` assumes contains the stdlib, and other Swift code built fat from the get-go. `libSwiftScan` is a part of the compiler build, and is therefore built for the host in a given build, which means toolchain installation requries that we use `lipo` to produce a fat shared library for it.

Resolves rdar://74490218
2021-04-19 15:11:04 -07:00
Mishal Shah
8d9db1c182 Add support for release/5.5 branch in update-checkout script 2021-04-16 23:28:29 -07:00
Eric Miotto
3a551f8fcc [build] allow to specify ninja targets to build for LLVM (#36910)
This is meant to support scenarios in which we need to build as little as
LLVM as possible for performance reasons (e.g. when enabling LTO).

While LLVM CMake build system offers options in this sense,
in our investigation they turned out not to be suitable,
since either they are not granular enough (`LLVM_INCLUDE/BUILD` flags)
or they require active opt out for any new tool added
(`*_BUILD_*_TOOL` flags)

When using this mechanism, there is the possibility to specify different
targets to use for cross-compile hosts.

Supports rdar://32019390
2021-04-15 12:45:00 -07:00
Keith Smiley
23bb2338a6 Add support for cross compiling from Apple Silicon to Intel
If you have an Apple Silicon machine but want to produce an Intel
binary, using `--cross-compile-hosts macosx-x86_64` can be useful.
2021-04-12 16:44:00 -07:00
Alex Hoppen
5cf19e4570 Merge pull request #36646 from ahoppen/pr/verify-syntax-tree-build-swift
[libSyntax] Several fixes for libSyntax parsing
2021-04-12 10:07:32 +02:00
Alex Hoppen
a98173baa2 [libSyntax] Several fixes for libSyntax parsing
Fixe a couple of bugs in libSyntax parsing found by enabling `-verify-syntax-tree` for `%target-build-swift`:
- Fix parsing of the `actor` contextual keyword in actor decls
- Don't build a libSyntax tree when parsing the availability macro
  - The availability macro is not part of the source code and doesn't form a valid Swift file, thus creation of a libSyntax tree is completely pointless and will fail
- Add support for parsing `@_originallyDefinedIn` attributes.
- Add support for parsing `#sourceLocation` in member decl lists
- Add support for effectful properties (throwing/async getters/setters)
- Add support for optional types as the base of a key path (e.g. `\TestOptional2?.something`)
- Allow platform restrictions without a version (e.g. `_iOS13Aligned`)
2021-04-09 14:16:51 +02:00
Mishal Shah
a93593a6f5 Merge pull request #36366 from apple/revert-36361-revert-36296-shahmishal/bump-yams-argument-parser-tag
Revert "Revert "Bump the Yams and swift-argument-parser tag for main and release/5.4""
2021-04-08 20:07:44 -07:00
Cassie Jones
35f6e58c89 Merge pull request #36809 from porglezomp-misc/test-more-thorough
[build-script] Fix tests that assertRaises incorrectly
2021-04-08 16:06:46 -04:00
Robert Widmann
eeb0ea29ff Merge pull request #36801 from CodaFi/copy-that
Just cp compiler-rt Files If lipo Fails
2021-04-07 21:08:34 -07:00