Commit Graph

5698 Commits

Author SHA1 Message Date
Karoy Lorentey
37d52fbb16 Merge pull request #35888 from lorentey/split-cmdline-improvements
[utils] split-cmdline: Handle typical compiler invocations better
2021-02-16 10:27:52 -08:00
Eric Miotto
44708dc739 Skip libdispatch build for freestanding presets (#35976)
Addresses rdar://74349391
2021-02-16 07:04:15 -08:00
Argyrios Kyrtzidis
9ef86bd110 Merge pull request #35873 from nathawes/cursor-info-parent-usrs
[SourceKit][SymbolGraph] Add a 'parent_contexts' field the CursorInfo response
2021-02-11 21:24:01 -08:00
Alex Hoppen
731d7e81a1 Merge pull request #35914 from ahoppen/pr/verify-generated-files
[build-presets] Verify generated SwiftSyntax files during Swift smoke testing
2021-02-11 15:31:30 +01:00
Alex Hoppen
cb1e729ffe [build-presets] Verify generated SwiftSyntax files during Swift smoke testing 2021-02-11 09:18:24 +01:00
Alex Hoppen
512411bc39 Merge pull request #35733 from ahoppen/raw-syntax-text-storage
[libSyntax] Store the token's text in the SyntaxArena
2021-02-11 08:12:03 +01:00
Karoy Lorentey
c195b2e724 [utils] split-cmdline: Handle -working-directory 2021-02-10 13:11:05 -08:00
Karoy Lorentey
33049fab81 [utils] split-cmdline: Handle typical compiler invocations better
Add a general heuristic that options ending in -path expect an argument.

Remove such options from the explicit is_arg_param list and sort it to simplify maintenance.

Recognize -target-sdk-version.
2021-02-10 13:01:51 -08:00
Eric Miotto
1c126eb09b Allow cross host compilation without stdlib build (#35858)
This is to support certain build configuration which will provide the
stdlib/runtime for the cross target by a different means.

Addresses rdar://74188174, rdar://74154062
2021-02-10 11:33:38 -08:00
Evan Wilde
fc41826da9 Rename 'actor class' -> 'actor'
This patch softly updates the spelling of actors from `actor class` to
`actor`. We still accept using `actor` as a modifying attribute of
class, but emit a warning and fix-it to make the change.

One of the challenges that makes this messier is that the modifier list
can be in any order. e.g, `public actor class Foo {}` is the same as
`actor public class Foo {}`.

Classes have been updated to include whether they were explicitly
declared as an actor. This change updates the swiftmodule serialization
version number to 0.591. The additional bit only gets set of the class
declaration was declared as an actor, not if the actor was applied as an
attribute. This allows us to correctly emit `actor class` vs `actor`
emitting the code back out.
2021-02-10 08:05:57 -08:00
Alex Hoppen
e43bad2c71 [libSyntax] Store the token's text in the SyntaxArena
Do the same thing that we are already doing for trivia: Since RawSyntax
nodes always live inside a SyntaxArena, we don't need to tail-allocate
an OwnedString to store the token's text. Instead we can just copy it
to the SyntaxArena. If we copy the entire source buffer to the syntax
arena at the start of parsing, this means that no more copies are
required later on. Plus we also avoid ref-counting the OwnedString which
should also increase performance.
2021-02-10 09:50:12 +01:00
Nathan Hawes
6d940951ca [SourceKit][SymbolGraph] Add a 'ParentContexts' field the CursorInfo response
When the SymbolGraph json is requested via (key.retrieve_symbol_graph: 1) this adds
a new field in the response that lists all the parent contexts of the symbol under
the cursor with their symbol graph kind and name, and their USR:

key.parent_contexts: [
    {
      key.kind: "swift.struct",
      key.name: "Parent",
      key.usr: "s:27cursor_symbol_graph_parents6ParentV"
    },
    ...
  ]
}

Resolves rdar://problem/73904365
2021-02-10 16:35:57 +10:00
Ben Rimmington
385fa77fd1 Add support for Xcode 12.4 (12D4e) (#35739) 2021-02-09 12:39:18 +00:00
Erik Eckstein
ee5491a7c9 PassManager: simplify the options to print intermediate SIL.
* rename -sil-print-only-function to -sil-print-function and -sil-print-only-functions to -sil-print-functions
* to print single functions, don't require -Xllvm -sil-print-all. It's now sufficient to use e.g. -Xllvm -sil-print-function=<f>
But it's still possible to select functions with -sil-print-function(s) for other print options, -sil-print-after.
2021-02-09 09:12:06 +01:00
swift-ci
2d2a810e66 Merge pull request #35810 from 3405691582/ValidationTestsOpenBSD 2021-02-08 14:22:10 -08:00
Rintaro Ishizaki
cbbeb91c4e Merge pull request #35768 from rintaro/sourcekit-dependencyupdated
[SourceKit] Add a request kind to notify dependencies are updated
2021-02-08 09:44:22 -08:00
Richard Wei
18fe723543 Merge pull request #35811 from rxwei/69980056-differentiable-reverse
[AutoDiff] Add '@differentiable(reverse)'.
2021-02-08 04:32:27 -08:00
Richard Wei
af8942d940 [AutoDiff] Rename '@differentiable' to '@differentiable(reverse)'.
Compiler:
- Add `Forward` and `Reverse` to `DifferentiabilityKind`.
- Expand `DifferentiabilityMask` in `ExtInfo` to 3 bits so that it now holds all 4 cases of `DifferentiabilityKind`.
- Parse `@differentiable(reverse)` and `@differentiable(_forward)` declaration attributes and type attributes.
- Emit a warning for `@differentiable` without `reverse`.
- Emit an error for `@differentiable(_forward)`.
- Rename `@differentiable(linear)` to `@differentiable(_linear)`.
- Make `@differentiable(reverse)` type lowering go through today's `@differentiable` code path. We will specialize it to reverse-mode in a follow-up patch.

ABI:
- Add `Forward` and `Reverse` to `FunctionMetadataDifferentiabilityKind`.
- Extend `TargetFunctionTypeFlags` by 1 bit to store the highest bit of differentiability kind (linear). Note that there is a 2-bit gap in `DifferentiabilityMask` which is reserved for `AsyncMask` and `ConcurrentMask`; `AsyncMask` is ABI-stable so we cannot change that.

_Differentiation module:
- Replace all occurrences of `@differentiable` with `@differentiable(reverse)`.
- Delete `_transpose(of:)`.

Resolves rdar://69980056.
2021-02-07 14:09:46 -08:00
buttaface
e6f5913772 [android] Move to the NDK's unified sysroot (#34491)
Since the NDK removes the platforms/ and sysroot/ directories in the latest NDK
22, switch to the unified sysroot in toolchains/llvm/ and take advantage of a
bunch of simplification that's now possible.
2021-02-07 09:19:18 -08:00
Mishal Shah
fb1f9e4e36 Update the test default for test_ios_32bit_simulator 2021-02-06 22:02:45 -08:00
3405691582
e81534960c [validation] Fix some portability test issues.
Here we fix a few portability issues affecting running the validation tests on OpenBSD. The remaining failures will be dealt with separately.

1. In the `rth` tool, ensure `-z origin` is specified to the linker when
   using `$ORIGIN`, as required on this platform.

2. Explicitly set the rpath in the `dsohandle-multi-module` execution
   test, since the test uses built dynamic libraries during the test.

3. Erase the environment variable instead of using `env -u`, the latter
   of which is not portable.
2021-02-06 16:36:44 -05:00
Rintaro Ishizaki
27dc2cf406 [SourceKit] Add a request kind to notify dependencies are updated 2021-02-05 18:41:26 -08:00
Dario Rexin
bcd6416c89 Revert "[Concurrency] Build C only libdispatch before Swift on non-Darwin pla… (#35738)" (#35789)
This reverts commit 74e59ab77f.
2021-02-05 13:51:39 -08:00
Dario Rexin
74e59ab77f [Concurrency] Build C only libdispatch before Swift on non-Darwin pla… (#35738)
* [Concurrency] Build C only libdispatch before Swift on non-Darwin platforms

_Concurrency depends on libdispatch and since it is not available by
default on non-Darwin platforms, it needs to be built before the Swift
project, so that the dependency can be resolved.

* Fix clibdispatch installation and BuildSystem tests

* Fix build system tests on Darwin and formatting
2021-02-04 17:15:30 -08:00
Mishal Shah
5e5a6caf32 [Build System] Disable running 32bit iOS simulator by default 2021-02-04 16:23:40 -08:00
Eric Miotto
693e487771 Use --relocate-xdg-cache-home-under-build-subdir for some Linux presets
This should reduce the frequency of module errors due to shared module caches between runs on the same Linux bot.

The list of presets affected should be

```
buildbot_incremental_linux
buildbot_incremental_linux,asan
buildbot_incremental_linux,llvm-only
buildbot_incremental_linux,long_test
buildbot_incremental_linux,tsan-libdispatch-test
buildbot_incremental_linux_1404
buildbot_incremental_linux_1404,long_test
buildbot_incremental_linux_base
buildbot_linux
buildbot_linux,foundation=debug
buildbot_linux,foundation=release
buildbot_linux,no_test
buildbot_linux,smoketest
buildbot_linux_1404_no_lldb
buildbot_linux_1510
buildbot_linux_1510,notest
buildbot_linux_1604
buildbot_linux_1604,notest
buildbot_linux_1610
buildbot_linux_1610,notest
buildbot_linux_1804
buildbot_linux_1804,notest
mixin_linux_installation
```

Addresses rdar://73932610, rdar://73933230
2021-02-04 09:49:30 -08:00
Ben Barham
b378c58525 Merge pull request #35722 from bnbarham/doc-async-attribute
[SourceKit/DocSupport] Add a field to mark functions that are async
2021-02-04 13:56:16 +10:00
Eric Miotto
e12d927627 Use --relocate-xdg-cache-home-under-build-subdir for Linux PR presets 2021-02-03 20:10:46 +00:00
Eric Miotto
c3eed05f6d Use --relocate-xdg-cache-home-under-build-subdir for Linux incremental presets 2021-02-03 20:09:57 +00:00
Eric Miotto
187f4dbaf8 [Build] Add option to alter default location of module cache in Linux (#35711)
This is meant to support parallel CI runs on the same Linux bot, so that
they don't share the module cache and reduce (hopefully) the likelihood
of issues related to invalid signatures.

When the option is enabled, the environment variable `XDG_CACHE_HOME`
is explicitly set in `build-script` and should be inherited by all the
child processes.
Currently we don't check the operating system before setting the
variable (since it should be a noop for other OSes).

Addresses rdar://73887745
2021-02-03 07:32:29 -08:00
Ben Barham
6544ba163e [SourceKit/DocSupport] Add a field to mark functions that are async
Resolves rdar://72444843
2021-02-03 15:56:21 +10:00
Mishal Shah
0b631006d2 Merge pull request #35507 from yim-lee/update-crypto
[update-checkout] Add swift-crypto to the list of repos
2021-02-02 18:41:31 -08:00
Alex Hoppen
3ec0ddc67e Merge pull request #35551 from ahoppen/fix-process-stats-dir
[Stats] Fix a second/nanoseconds bug in process-stats-dir
2021-02-02 19:49:52 +01:00
Yim Lee
2766cad22c Specify swift-crypto version
Use `main` branch for now so we can test changes in SwiftPM. We will pin to version later.
2021-02-02 10:08:44 -08:00
Yim Lee
ad7ef87ea3 [update-checkout] Add swift-crypto to the list of repos
This is for https://github.com/apple/swift-package-manager/pull/3202, which adds swift-crypto as a new dependency to SwiftPM to support the upcoming package collection feature.
2021-02-02 10:08:44 -08:00
Ikko Ashimine
666bd038a1 Fix typo in AttributeNodes.py
identifer -> identifier
2021-02-01 23:51:53 +09:00
Varun Gandhi
36b589d623 Merge pull request #35538 from mininny/disable-dead-stripping-option
[build-script] Add swift-disable-dead-stripping option for disabling dead stripping
2021-01-31 16:31:48 -08:00
Minhyuk Kim
16e635b005 Fix test 2021-01-31 12:51:24 +09:00
Mishal Shah
9a336f2528 Disable CMark tests by default 2021-01-30 11:43:00 -08:00
Mishal Shah
84a29e7b4e Disable CMark test for buildbot,tools=RA,stdlib=RD,test=non_executable preset 2021-01-29 09:14:58 -08:00
Mishal Shah
61aba8d896 Merge pull request #35613 from ahoppen/smoke-test-swiftsyntax
[build-presets] Test Swift Syntax during macOS PR smoke testing
2021-01-27 14:03:45 -08:00
Eric Miotto
f9be289b9e [build] Amend target options for common C flags (#35559)
Follow up of #35406

Addresses rdar://73502059
2021-01-27 07:06:21 -08:00
Alex Hoppen
7d7d984455 [build-presets] Test Swift Syntax during macOS PR smoke testing
There have been occasions in the past where changes to the
gyb_syntax_support broke the SwiftSyntax build that weren't caught in CI
because smoke test didn't build/test the downstream Swift Syntax project.
2021-01-27 09:35:21 +01:00
Philippe Hausler
6e05240426 AsyncSequence and protocol conformance rethrows (#35224)
* Initial draft of async sequences

* Adjust AsyncSequence associated type requirements

* Add a draft implementation of AsyncSequence and associated functionality

* Correct merge damage and rename from GeneratorProtocol to AsyncIteratorProtocol

* Add AsyncSequence types to the cmake lists

* Add cancellation support

* [DRAFT] Implementation of protocol conformance rethrowing

* Account for ASTVerifier passes to ensure throwing and by conformance rethrowing verifies appropriately

* Remove commented out code

* OtherConstructorDeclRefExpr can also be a source of a rethrowing kind function

* Re-order the checkApply logic to account for existing throwing calculations better

* Extract rethrowing calculation into smaller functions

* Allow for closures and protocol conformances to contribute to throwing

* Add unit tests for conformance based rethrowing

* Restrict rethrowing requirements to only protocols marked with @rethrows

* Correct logic for gating of `@rethrows` and adjust the determinates to be based upon throws and not rethrows spelling

* Attempt to unify the async sequence features together

* Reorder try await to latest syntax

* revert back to the inout diagnosis

* House mutations in local scope

* Revert "House mutations in local scope"

This reverts commit d91f1b25b59fff8e4be107c808895ff3f293b394.

* Adjust for inout diagnostics and fall back to original mutation strategy

* Convert async flag to source locations and add initial try support to for await in syntax

* Fix case typo of MinMax.swift

* Adjust rethrowing tests to account for changes associated with @rethrows

* Allow parsing and diagnostics associated with try applied to for await in syntax

* Correct the code-completion for @rethrows

* Additional corrections for the code-completion for @rethrows this time for the last in the list

* Handle throwing cases of iteration of async sequences

* restore building XCTest

* First wave of feedback fixes

* Rework constraints checking for async sequence for-try-await-in checking

* Allow testing of for-await-in parsing and silgen testing and add unit tests for both

* Remove async sequence operators for now

* Back out cancellation of AsyncIteratorProtocols

* Restructure protocol conformance throws checking and cache results

* remove some stray whitespaces

* Correct some merge damage

* Ensure the throwing determinate for applying for-await-in always has a valid value and adjust the for-await-in silgen test to reflect the cancel changes

* Squelch the python linter for line length
2021-01-25 18:48:50 -08:00
Minhyuk Kim
b0426829fe Add swift_disable_dead_stripping option for disabling dead stripping in Swift build 2021-01-22 23:56:02 +09:00
Alex Hoppen
13dd22f0cc [scale-test] Don't consider timers for the scale tests
Timers are just too noisy to give reliable results. Previously, the
timers were not considered due to a bug in process-stats-dir that would
(almost) always output 0. This bug has been fixed in 92073c671e.
2021-01-22 14:50:07 +01:00
Alex Hoppen
92073c671e [Stats] Fix a second/nanoseconds bug in process-stats-dir
Times are expected to be represented in nanoseconds in process-stats-dir,
but times with the 'swift.time.' prefix (e.g. times for specific
requests) were not converted.

It appears the reasons that this hasn’t been caught so far, is that
these times are not shown in Swift-CI's please test compiler performance
report.
2021-01-22 10:25:22 +01:00
Ikko Ashimine
f1c38a7d64 NFC: fix typo in versions.py
boundries -> boundaries
2021-01-21 23:52:48 +09:00
Ikko Ashimine
802788fc1b Fix typo in build-script-impl
targetting -> targeting
2021-01-20 23:09:34 +09:00
Alex Hoppen
bfe0a00551 Merge pull request #35429 from ahoppen/remove-bytetree
Remove ByteTree serialization format
2021-01-15 09:28:19 +01:00