Commit Graph

5652 Commits

Author SHA1 Message Date
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
Cassie Jones
e5b0adcdc3 [build-script] Fix tests that assertRaises incorrectly 2021-04-07 22:58:04 -04:00
Cassie Jones
c4b19ca09c Merge pull request #36790 from porglezomp-misc/patch-patch-patch
[build-script] Support 5-component Swift versions
2021-04-07 22:57:04 -04:00
Robert Widmann
1fda005789 Just cp compiler-rt Files If lipo Fails
This workaround to remove legacy architectures from the .a's can fail.
When that happens, it usually means i386 was not among any of the slices
to begin with, so just copy the library out to its destination.
2021-04-07 13:09:02 -07:00
Alex Hoppen
294977534c [libSyntax] Remove incremental JSON transfer option
We were only keeping track of `RawSyntax` node IDs to incrementally transfer a syntax tree via JSON. However, AFAICT the incremental JSON transfer option has been superceeded by `SyntaxParseActions`, which are more efficient.

So, let’s clean up and remove the `RawSyntax` node ID and JSON incremental transfer option.

In places that still need a notion of `RawSyntax` identity (like determining the reused syntax regions), use the `RawSyntax`’s pointer instead of the manually created ID.

In `incr_transfer_round_trip.py` always use the code path that uses the `SyntaxParseActions` and remove the transitional code that was still using the incremental JSON transfer but was never called.
2021-04-07 10:01:34 +02:00
Cassie Jones
7ed0023f17 [build-script] Support 5-component Swift versions
Resolves rdar://76236775
2021-04-06 20:13:51 -04:00
Nathan Hawes
6ca5b3261e Merge pull request #36713 from nathawes/add-fragment-info-with-symbol-graph
[SourceKit/CursorInfo] Report the set of decls referenced in the symbol graph's "declarationFragments" field.
2021-04-06 18:26:21 +10:00
Eric Miotto
d350a0525e [build] Clean llbuild before building by default (#36686)
Introduce a new parameter `--skip-llbuild-clean` to prevent this from
happening.

This mimicks similar logic in place for `swiftpm`, `swift-driver`
(#33563)  and `xctest` (#19512)

Addresses rdar://75057069
2021-04-05 07:19:40 -07:00
Nathan Hawes
08250f058a [SourceKit/CursorInfo] Report the set of decls referenced in the symbol graph's "declarationFragments" field.
Resolves rdar://75809521
2021-04-03 09:42:54 +10:00
Artem Chikin
b70c9679b7 Merge pull request #36656 from artemcm/FixRunTest
Set `run-test` script to be a python3 script
2021-03-31 13:05:33 -07:00
Slava Pestov
48b729d2f2 Merge pull request #36641 from slavapestov/more-reasync-fixes
More 'reasync' fixes
2021-03-31 15:43:59 -04:00
Ben Barham
0b3164203b Merge pull request #36547 from bnbarham/include-init
[SourceKit/CursorInfo] Add constructor to call results
2021-03-31 16:40:02 +10:00
Artem Chikin
65799c4e3e Set run-test script to be a python3 script 2021-03-30 13:27:11 -07:00
Eric Miotto
a9252354af [build] use python3 when testing installable package
`lit.py` now requires python3 to run
2021-03-30 08:03:09 -07:00
Slava Pestov
ce23d97ed4 Syntax: Add support for 'reasync' keyword 2021-03-29 23:49:30 -04:00
Ben Barham
3ea9bed415 [SourceKit/CursorInfo] Add constructor to call results
Cursor info for a constructor would previously give the cursor info for
the containing type only. It now also adds cursor info for the
constructor itself in a "secondary_symbols" field.

Refactor `passCursorInfoForDecl` to use a single allocator rather than
keeping track of positions in a buffer and assigning everything at the
end of the function.

Refactor the various available refactoring gathering functions to take a
SmallVectorImpl and to not copy strings where they don't need to.

Resolves rdar://75385556
2021-03-30 13:23:59 +10:00
Cassie Jones
5e9f8c05f6 Merge pull request #36453 from porglezomp-misc/keep-the-sccache-warm
[build-script] Ensure the sccache server is started before building
2021-03-24 22:31:49 -04:00
Erik Eckstein
8828d8e6bf tests: clean-up MemBehavior tests
Add more relevant instructions to dump in MemBehaviorDumper.
Therefore the -enable-mem-behavior-dump-all option can be removed.
Also mem-behavior-all.sil into mem-behavior.sil, because the sil-opt command lines don't differ anymore.
2021-03-24 11:19:00 +01:00
Cassie Jones
ae66a940a6 [build-script] Ensure the sccache server is started before building
Sometimes with the --sccache flag passed to build-script, the first
round of compiler invocations will time-out waiting for the sccache
server to start. Here we ensure the server is started ahead of time
to avoid this failure.

Resolves rdar://74951999
2021-03-23 17:00:28 -04:00
Ben Barham
8948a034c8 Merge pull request #36508 from bnbarham/static-dynamic-flag
[SourceKit/CursorInfo] Mark dynamic calls
2021-03-23 15:27:37 +10:00
Saleem Abdulrasool
714eaefc78 Importer: remove ImportAsMember support
This functionality is not actively in use and the last usage of this has
been removed.  Remove the infrastructure that is no longer in need.
2021-03-22 08:53:56 -07:00
Ben Barham
19f23130d0 [SourceKit/CursorInfo] Mark dynamic calls
Adds two new fields to the cursor info response:
  1. is_dynamic: whether a call is dynamic
  2. receivers: receivers of the call (USRs)

Users of the CursorInfo request can use "is_dynamic" to decide whether
to lookup overrides or not, and then the "receivers" as the starting
point of the lookup.

Resolves rdar://75385900
2021-03-20 13:57:01 +10:00
Nathan Hawes
839500867c Merge pull request #36486 from nathawes/add-language-to-cursor-info
[SourceKit][CursorInfo] Add a field for the source language the symbol was originally defined in
2021-03-19 13:47:09 +10:00
Nathan Hawes
e1a4c5f846 [SourceKit][CursorInfo] Add a field for the source language the symbol was originally defined in
Resolves rdar://75446903
2021-03-18 18:49:25 +10:00
Ted Kremenek
8256a4e91c Update Swift version to 5.5 2021-03-16 21:29:13 -07:00
Alex Hoppen
91be112771 Merge pull request #36383 from kimdv/kimdv/add-leading-trailing-space-for-token
[libSyntax] Add leading and trailing space property for Token
2021-03-16 09:46:04 +01:00
Xi Ge
2a1a7a8bca Merge pull request #36388 from nkcsgexi/75275788
driver: prefer a new driver name as swift-driver instead of swift-driver-new
2021-03-15 12:04:30 -07:00
Xi Ge
b948f20e41 build-script: keep SwiftDriver as the last product to build 2021-03-13 22:07:26 -08:00
Kim de Vos
df8624283a Add leading and trailing space property for Token 2021-03-11 10:53:50 +01:00
Mishal Shah
8fd976e9eb Bump the Swift Argument Parser tag to 0.4.1 2021-03-09 10:24:28 -08:00
Mishal Shah
2b9937f87e Revert "Revert "Bump the Yams and swift-argument-parser tag for main and release/5.4"" 2021-03-09 10:04:25 -08:00
Mishal Shah
60c8f71df2 Revert "Bump the Yams and swift-argument-parser tag for main and release/5.4" 2021-03-08 23:53:03 -08:00
Mishal Shah
29b162803f Merge branch 'main' into shahmishal/bump-yams-argument-parser-tag 2021-03-08 13:18:28 -08:00
Yim Lee
2e54ead452 [update-checkout] Update swift-crypto to 1.1.5
[v1.1.5](https://github.com/apple/swift-crypto/releases/tag/1.1.5) contains a fix for cmake build on aarch64
2021-03-05 09:00:53 -08:00
Mishal Shah
f5bb69c3a9 Bump the Yams and swift-argument-parser tag for main and release/5.4
* Yams (4.0.2) and swift-argument-parser (0.4.0) are required to support Apple Silicon
2021-03-04 16:03:46 -08:00
Mishal Shah
afb3110e21 [Preset] Add Apple Silicon preset 2021-03-03 14:59:37 -08:00
Cassie Jones
b64bd95d1c Merge pull request #36222 from porglezomp-misc/swift-driver-lit-tests
[build-script] Pass --lit-test-dir while testing swift-driver
2021-03-02 18:34:33 -05:00
Alex Hoppen
96cb75608c Merge pull request #36165 from ahoppen/pr/dont-ref-count-rawsyntax
[libSyntax] Don't reference count RawSyntax
2021-03-02 17:40:17 +01:00
Cassie Jones
cb58d25c1d [build-script] Pass --lit-test-dir while testing swift-driver 2021-03-01 20:56:08 -05:00
Alex Hoppen
28f5f79bb7 [libSyntax] Don't reference count RawSyntax
Instead, only reference count the SyntaxArena that the RawSyntax nodes
live in. The user of RawSyntax nodes must guarantee that the SyntaxArena
stays alive as long as the RawSyntax nodes are being accessed.

During parse time, the SyntaxTreeCreator holds on to the SyntaxArena
in which it creates RawSyntax nodes. When inspecting a syntax tree,
the root SyntaxData node keeps the SyntaxArena alive. The change should
be mostly invisible to the users of the public libSyntax API.

This change significantly decreases the overall reference-counting
overhead. Since we were not able to free individual RawSyntax nodes
anyway, performing the reference-counting on the level of the
SyntaxArena feels natural.
2021-03-01 09:43:54 +01:00
Andrew Trick
1fa76ba811 swift-autocomplete.bash, rename 'options' for zsh compat 2021-02-27 22:29:49 -08:00
Andrew Trick
74ad3e0a4e Add swift-frontend to the autocomplete command set. 2021-02-27 21:05:01 -08:00
Argyrios Kyrtzidis
1620f2cb49 Merge pull request #36178 from akyrtzi/build-parser-lib-improvements
[parser lib] A few enhancements for the syntax-parser-only build
2021-02-26 12:16:03 -08:00
Argyrios Kyrtzidis
8cbfb545a2 [parser lib] A few enhancements for the syntax-parser-only build
* Make the `build-parser-lib` script more flexible on how it finds the llvm source path
* Make sure `swift-syntax-parser-test` can be built even though the script disables building for testing
* Fix a linker error for parser-only build
2021-02-26 08:39:24 -08:00
Erik Eckstein
8dfd2491a8 swift-autocomplete.bash: add the missing -Xllvm -sil-print-function option 2021-02-26 16:07:48 +01:00
Mishal Shah
88d3facc9f Merge pull request #35999 from yim-lee/pin-swift-crypto
[update-checkout] Pin swift-crypto to a version
2021-02-24 19:09:22 -08:00