Commit Graph

6605 Commits

Author SHA1 Message Date
Alex Hoppen
de25265de0 [SourceKit] Remove ability to specify fixed snapshots to use when building an AST
The feature was never used and just complicated the implementation.
2021-12-08 15:17:13 +01:00
swift-ci
924a6cb2a0 Merge remote-tracking branch 'origin/main' into rebranch 2021-12-08 04:34:01 -08:00
Augusto Noronha
beb99a432e Merge pull request #40452 from augusto2112/refl-dump-use-stream
Modify reflection dumping to use std::ostream instead of FILE *
2021-12-08 09:29:03 -03:00
Augusto Noronha
385d91aeb8 Modify reflection dumping to use std::ostream instead of FILE * 2021-12-07 16:05:20 -03:00
swift-ci
8abc3941d1 Merge remote-tracking branch 'origin/main' into rebranch 2021-12-07 08:14:19 -08:00
Alex Hoppen
1739c23a9b Merge pull request #40158 from ahoppen/pr/cancel-code-completion
[SourceKit] Support cancellation of code completion like requests
2021-12-07 17:10:05 +01:00
swift-ci
7df0b044a4 Merge remote-tracking branch 'origin/main' into rebranch 2021-12-06 20:13:43 -08:00
swift-ci
fe4d9af277 Merge pull request #40404 from nate-chandler/lexical_lifetimes/renamed_flag 2021-12-06 20:12:59 -08:00
swift-ci
0a82d3f298 Merge remote-tracking branch 'origin/main' into rebranch 2021-12-04 16:33:42 -08:00
Connor Wakamo
836782b7e0 Merge pull request #40247 from cwakamo/eng/PR-85511711-allow-disabling-SourceKit-XPC-service-build
[CMake] Added support for disabling building the SourceKit XPC service.

This addresses <rdar://problem/85511711>.
2021-12-04 16:25:56 -08:00
swift-ci
fcc173765f Merge remote-tracking branch 'origin/main' into rebranch 2021-12-04 09:33:47 -08:00
Rintaro Ishizaki
f17671c4a6 Guard a static assert for MSVC
MSVC doens't pack diffrent underlying int types into a bitfield. e.g.

  struct S {
    int a: 1;
    char b: 1;
    int c: 1;
  };

These fields are considered three sparate bitfields.
2021-12-04 00:19:25 -08:00
Nate Chandler
1961be8845 Renamed flag to -enable-lexical-lifetimes.
Previously, both swift-frontend and sil-opt put lexical lifetimes behind
a flag named -enable-experimental-lexical-lifetimes.  That's redundant.
Here, the experimental portion of the name is dropped.
2021-12-03 17:40:37 -08:00
Saleem Abdulrasool
1e5df70d89 build: add a workaround for CMake[>=3.22] and SourceKit
The switch between compilers causes problems due to new flags being used
for building.  This adds a workaround to avoid the search path
re-ordering which breaks the build with a newer CMake.
2021-12-03 16:26:38 -08:00
Connor Wakamo
3689d4c340 [CMake] Added support for disabling building the SourceKit XPC service.
Made `BUILD_SOURCEKIT_XPC_SERVICE` into an option so it can be set externally.
It continues to default to `TRUE` if `HAVE_XPC_H AND SWIFT_BUILD_SOURCEKIT` is
true, and `FALSE` otherwise, but this allows a client to disable this ahead of
time and build a sourcekitd.framework without the XPC service.

This addresses <rdar://problem/85511711>.
2021-12-03 15:59:25 -08:00
Rintaro Ishizaki
94a372e8ca [CodeCompletion] Use enums in bit fields as-is
We don't need to convert them from/to integer
2021-12-03 15:33:28 -08:00
swift-ci
ee8f9ee1f3 Merge remote-tracking branch 'origin/main' into rebranch 2021-12-03 15:14:24 -08:00
Connor Wakamo
b553a92718 Merge pull request #40235 from cwakamo/eng/PR-85511244-fix-some-SourceKit-CMake-issues
[CMake] Fix a couple SourceKit CMake issues.

This addresses <rdar://problem/85511244>.
2021-12-03 15:09:00 -08:00
swift-ci
0253584183 Merge remote-tracking branch 'origin/main' into rebranch 2021-12-02 19:34:04 -08:00
Xi Ge
6377c3a742 Revert "Revert "serialization: obfuscate the serialized search paths"" 2021-12-02 13:21:04 -08:00
swift-ci
72cd08094d Merge remote-tracking branch 'origin/main' into rebranch 2021-12-02 12:34:30 -08:00
Saleem Abdulrasool
11d5d6d4ca Revert "serialization: obfuscate the serialized search paths" 2021-12-02 08:18:23 -08:00
Alex Hoppen
177ab6e8e7 [SourceKit] Support cancellation of code completion like requests
Essentially, just wire up cancellation tokens and cancellation flags for `CompletionInstance` and make sure to return `CancellableResult::cancelled()` when cancellation is detected.

rdar://83391488
2021-12-02 13:05:03 +01:00
Alex Hoppen
d482ee392e [SourceKit] Make sourcektid_request_handle_t const void* 2021-12-02 13:03:17 +01:00
Alex Hoppen
9042536323 [SourceKit] Move the cancellation flag from TypeCheckerOptions to ASTContext
We need to modify the pointer pointing to the cancellation flag when reusing an ASTContext for code completion. This is not possible by the previous design because `TypeCheckerOptions` was `const`. Moving the cancellation flag to `ASTContext` will also allow other stages of the compiler to honor a cancellation request.
2021-12-02 12:57:34 +01:00
swift-ci
d52691dda3 Merge remote-tracking branch 'origin/main' into rebranch 2021-12-01 15:54:13 -08:00
Xi Ge
03d5a6ad85 Merge pull request #40357 from nkcsgexi/obfuscate-searialized-paths
serialization: obfuscate the serialized search paths
2021-12-01 15:45:47 -08:00
swift-ci
8de2ddb02e Merge remote-tracking branch 'origin/main' into rebranch 2021-12-01 13:54:08 -08:00
Alex Hoppen
9cd109cd16 Merge pull request #40353 from ahoppen/pr/no-semantic-info-if-not-requested
[SourceKit] Don't build an AST if no semantic info is requested
2021-12-01 22:42:11 +01:00
Alex Hoppen
558c3b240c Merge pull request #40169 from ahoppen/pr/add-disposecancellationtoken-to-exports
[SourceKit] Add `sourcekitd::disposeCancellationToken` to Darwin exports
2021-12-01 22:41:52 +01:00
Xi Ge
0047d81f9a serialization: obfuscate the serialized search paths
We noticed some Swift clients rely on the serialized search paths in the module to
find dependencies and droping these paths altogether can lead to build failures like
rdar://85840921.

This change teaches the serialization to obfuscate the search paths and the deserialization
to recover them. This allows clients to keep accessing these paths without exposing
them when shipping the module to other users.
2021-12-01 11:47:41 -08:00
Alex Hoppen
debeebb443 [SourceKit] Don't build an AST if no semantic info is requested
Currently, we were building an AST on document open or edit even if
- `key_enablesyntaxmap` = 0
- `key_enablesubstructure` = 0
- `key_enablediagnostics` = 0 and
- syntax tree transfer mode is off

In those cases we were just ignoring the result.

If all of the options are 0, don’t build an AST.

rdar://85847659
2021-12-01 16:47:50 +01:00
swift-ci
bc71cf7c54 Merge remote-tracking branch 'origin/main' into rebranch 2021-11-30 15:21:46 -08:00
Ben Barham
9180e010c1 Merge pull request #40323 from bnbarham/lint-crash
[SourceKit] Add structure node for SubscriptExpr
2021-12-01 08:57:16 +10:00
swift-ci
ee96d2798c Merge remote-tracking branch 'origin/main' into rebranch 2021-11-30 08:33:02 -08:00
Saleem Abdulrasool
349af3707d Merge pull request #40305 from compnerd/semitruck
gardening: make c++98-compat-extra-semi an error
2021-11-30 08:18:36 -08:00
Ben Barham
cb81c1a1aa [SourceKit] Add structure node for SubscriptExpr
Arguments in `SubscriptExpr` are visited since the recent `ArgumentList`
refactoring, but were being added to the containing `CallExpr`. Add a
node for the `SubscriptExpr` itself so that its argument is added there
instead of the `CallExpr`.

Also remove `key.nameoffset` and `key.namelength` from the response when
both are 0 to match the rest of the offsets and lengths.

Resolves rdar://85412164.
2021-11-30 19:56:48 +10:00
swift-ci
9f8035987f Merge remote-tracking branch 'origin/main' into rebranch 2021-11-29 14:53:04 -08:00
Rintaro Ishizaki
5a006d2eda Merge pull request #40249 from rintaro/sourcekid-repl-time
[sourcekitd-repl] 'time' requests
2021-11-29 14:47:15 -08:00
Saleem Abdulrasool
8e0adec743 Update sourcekitd-repl.cpp 2021-11-29 09:49:32 -08:00
swift-ci
ea91d8d7f0 Merge remote-tracking branch 'origin/main' into rebranch 2021-11-29 00:32:49 -08:00
eeckstein
cbf3c5815b Merge pull request #40285 from eeckstein/libswift-build-fixes
cmake: three fixes for the libswift build
2021-11-29 09:14:02 +01:00
swift-ci
844c9e802c Merge remote-tracking branch 'origin/main' into rebranch 2021-11-28 21:53:03 -08:00
Becca Royal-Gordon
5a1e042c9f Merge pull request #40267 from beccadax/send-me-an-object-recommit
[Re-merge] Support __available__((swift_attr("@Sendable")))
2021-11-28 21:43:24 -08:00
Saleem Abdulrasool
910fbee14e gardening: make c++98-compat-extra-semi an error
This cleans up 90 instances of this warning and reduces the build spew
when building on Linux.  This helps identify actual issues when
building which can get lost in the stream of warning messages.  It also
helps restore the ability to build the compiler with gcc.
2021-11-27 11:40:17 -08:00
Erik Eckstein
61db072617 cmake: fix libswift build dependencies
Unfortunately using the convenient "bootstrapping0-all", etc. custom targets does not work.
For some reason it does not cause a dependent file (like libswift's SIL.o) being rebuilt when a depenency (like swift-frontend from the previous bootstrapping stage) changes.
Instead we have to list al library- and executable-targets explicitly.
2021-11-23 18:33:43 +01:00
Becca Royal-Gordon
1880118e70 Restructure getDisplayDecl() Sendable forcing
Move this into a helper function that lives in Sema, avoiding libswiftAST calling into libswiftSema.
2021-11-19 17:51:27 -08:00
swift-ci
908cd43b0d Merge remote-tracking branch 'origin/main' into rebranch 2021-11-19 12:13:27 -08:00
swift-ci
17f1cf9297 Merge pull request #40240 from rxwei/string-processing-module 2021-11-19 12:12:06 -08:00
Becca Royal-Gordon
4e383e3987 Fix swift-dependency-tool dependencies 2021-11-19 11:34:02 -08:00