Commit Graph

6605 Commits

Author SHA1 Message Date
Robert Widmann
2ac4283538 Merge pull request #41860 from keith/ks/swift-stdlib-tool-reject-invalid-arguments
[swift-stdlib-tool] Reject invalid arguments
2022-05-02 14:36:52 -07:00
Robert Widmann
17e8d5c6d2 Merge pull request #41877 from keith/ks/swift-stdlib-tool-add-error-for-missing-directories
[swift-stdlib-tool] Add error for missing directories
2022-05-02 14:34:43 -07:00
Saleem Abdulrasool
3b661bc9fa Merge pull request #58615 from compnerd/release
swift-inspect: update instructions for Windows
2022-05-02 12:44:31 -07:00
Mishal Shah
d292a852d8 Merge pull request #40188 from apple/QuietMisdreavus/cmark
use swift-cmark/gfm instead of /main
2022-05-02 10:20:23 -07:00
Saleem Abdulrasool
ebf1cec6a6 swift-inspect: update instructions for Windows
Remove the reference to `DEVELOPER_DIR` and update the instructions to
actually be usable with a released snapshot (and official releases).
The development setup should mimic the actual layout further and is a
separate issue.  This requires a new snapshot with
apple/swift-installer-scripts#128 included.
2022-05-02 08:22:18 -07:00
Josh Soref
6445de79e9 spelling: replacement
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-30 23:34:08 -04:00
Josh Soref
77b31ff0d8 spelling: error
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-30 23:34:08 -04:00
Josh Soref
c0775196ec spelling: serialized
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-30 23:33:05 -04:00
Josh Soref
36b6faa287 spelling: available
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-30 23:33:05 -04:00
Rintaro Ishizaki
30a53fed05 Merge pull request #42583 from rintaro/regex_diagnostics
[SwiftCompiler/Regex] Use bridged DiagnosticEngine for error reporting
2022-04-25 08:26:38 -07:00
Alex Hoppen
df710efe34 Merge pull request #42574 from ahoppen/pr/report-more-specific-compilation-setup-failed-error
[SourceKit] If setting up the compiler instance failed with an error, don't override it with a generic error message
2022-04-25 10:16:09 +02:00
Rintaro Ishizaki
79bbbf1fa5 [SourceKit] Remove an unnecessary link and an include from SourceKitSupport 2022-04-22 23:16:52 -07:00
Alex Hoppen
0124407300 [SourceKit] If setting up the compiler instance failed with an error, don't override it with a generic error message 2022-04-22 15:08:56 +02:00
Zoe Carver
320e4c63cb Merge pull request #42511 from zoecarver/add-flag-import-as-computed-property 2022-04-20 22:47:21 -07:00
Doug Gregor
4116d7a3d7 Rename the -strict-concurrency= options to be more descriptive.
The three options are now:

* `explicit`: Enforce Sendable constraints where it has been explicitly adopted and perform actor-isolation checking wherever code has adopted concurrency. (This is the default)
* `targeted`: Enforce Sendable constraints and perform actor-isolation checking wherever code has adopted concurrency, including code that has explicitly adopted Sendable.
* `complete`: Enforce Sendable constraints and actor-isolation checking throughout the entire module.
2022-04-20 18:17:33 -07:00
zoecarver
21192904ba [cxx-interop][nfc] Add flag cxx-interop-getters-setters-as-properties.
This is causing problems in certain cases, disabling by default.
2022-04-20 17:32:26 -07:00
Doug Gregor
7a724c4586 Add frontend flag -swift-concurrency={off|limited|on}
Replace `-warn-concurrency` with a more granular option
`-swift-concurrency=`, where the developer can select one of three
different "modes":

* `off` disables `Sendable` checking for most cases. (This is the Swift
5.5 and Swift 5.6 behavior.)
* `limited` enables `Sendable` checking within code that has adopted
Swift concurrency. (This is currently the default behavior.)
* `on` enables `Sendable` and other concurrency checking throughout
the module. (This is equivalent to `-warn-concurrency` now).

There is currently no distinction between `off` and `limited`. That
will come soon.

Implements the flag part of rdar://91930849.
2022-04-18 18:12:10 -07:00
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
Alex Hoppen
11c3ff0534 Merge pull request #42211 from ahoppen/pr/dont-distinguish-identical-convertible-type-relation
[CodeCompletion] Don't distinguish convertible and identical type relation
2022-04-13 12:01:25 +02:00
Alex Hoppen
5d01a097e1 [CodeCompletion] Don't distinguish convertible and idenical type relation
I think that preferring identical over convertible makes sense in e.g. C++ where we have implicit user-defined type conversions but since we don’t have them in Swift, I think the distinction doesn’t make too much sense, because if we have a `func foo(x: Int?)`, want don’t really want to  prioritize variables of type `Int?` over `Int` Similarly if we have `func foo(x: View)`, we don’t want to prioritize a variable of type `View` over e.g. `Text`.

rdar://91349364
2022-04-13 08:28:17 +02:00
Hamish Knight
63b8db1659 Start using '-enable-bare-slash-regex'
Change the flag to imply
'-enable-experimental-string-processing', and
and update some tests to start using it.
2022-04-12 16:03:47 +01:00
Ben Barham
96acd33650 Merge pull request #42268 from bnbarham/add-objc-doc-to-symbolgraph
[CursorInfo] Add Clang documentation to SymbolGraph output
2022-04-11 11:09:07 -07:00
Ben Barham
e2c9836a1d [CursorInfo] Add Clang documentation to SymbolGraph output
This currently doesn't check for inherited docs, ie. either the
imported declaration has docs or it doesn't. There's also a few odd
cases with mixed doc types and when each line is prefixed with '*', but
it's good enough for an initial implementation.

Moves UTF8 sanitisation out of ASTPrinter.h and into Unicode.h so that
it can be used here as well.

Resolves rdar://91388603.
2022-04-08 13:46:38 -07:00
Alex Hoppen
d7eada412f [SourceKit] Resolve a nondeterministic deadlock in SourceKit while cancelling
This fixes a race-conditioned deadlock which could occur while cancelling SourceKit AST build request

We have one thread that claimed `CancellationRequestCallbackMtx` in `SwiftASTConsumer::requestCancellation` and wants to claim `ConsumersAndResultMtx` in `ASTBuildOperation::requestConsumerCancellation`

Another thread claimed `ConsumersAndResultMtx` in `ASTBuildOperation::schedule` and now wants to claim `CancellationRequestCallbackMtx` in `SwiftASTConsumer::removeCancellationRequestCallback`.

In both cases we could actually release one lock before claiming the other.

Fixes rdar://90870793
2022-04-08 10:44:16 +02:00
zoecarver
839839f924 [cxx-interop] Rename enable-cxx-interop -> enable-experimental-cxx-interop.
Also removes the driver flag, this will now also always be guarded on `-Xfrontend`.
2022-04-07 19:15:25 -07:00
Allan Shortlidge
f0360a2984 Fix trivial warnings emitted during a full build. 2022-04-05 17:16:19 -07:00
Ben Barham
25232e8f96 Merge pull request #42166 from bnbarham/disable-cancellation
[SourceKit] Disable cancellation of in-flight non-completion requests
2022-04-05 08:52:33 -07:00
Richard Wei
065ac52c0d Add frontend flag -disable-implicit-string-processing-module-import.
We add a new flag to disable the implicit import of `_StringProcessing`, similar to `-disable-implicit-concurrency-module-import`. We need this to build `_RegexParser` when `-enable-experimental-string-processing` is enabled by default, because `_StringProcessing` currently imports `_RegexParser` publicly (non-implementation-only).
2022-04-04 13:55:47 -07:00
Ben Barham
7cd4937290 [SourceKit] Disable cancellation of in-flight non-completion requests
We need to run SILGen for diagnostics (to actually get all diagnostics).
All non-completion requests share an AST and thus they too run SILGen.
Any lazy typechecking run in SILGen assumes that it succeeds.

Cancellation can cause typechecking to fail here though, since we simply
check the flag and error if it's set. This unfortunately has the ability
to cause any any number of crashes since various invariants in SILGen
are then broken.

Disable cancellation of in-flight non-completion requests for now until
we have a proper fix in place.

Resolves rdar://91251017.
2022-04-04 13:13:33 -07:00
Alex Hoppen
0ded798ceb Merge pull request #42006 from ahoppen/pr/prepare-for-migrate-postfixexprparen
[CodeCompletion][Sema] Multiple improvements to prepare for migration of PostfixExprParen to solver-based
2022-04-03 16:43:36 +02:00
Rintaro Ishizaki
88e1905746 [SourceKit] Link SwiftCompilerModules to SourceKit
This is required for SourceKit to parse Regex literals

rdar://90236990
2022-03-30 09:14:57 -07:00
Ben Barham
ff5f1b9bff Merge pull request #41929 from bnbarham/ast-manager-use-overlays
[SourceKit] Make sure to use overlays when reading files
2022-03-25 10:02:32 -07:00
Alex Hoppen
db13ca8689 [swift-ide-test] Sort failed and upassed tokens before printing them 2022-03-25 09:36:05 +01:00
Doug Gregor
c4e6e6d105 Eliminate the EnableExperimentalDistributed language option.
Nothing is using it because this feature is enabled by default.
2022-03-24 16:00:26 -07:00
Ben Barham
15ada41a5a [SourceKit] Make sure to use overlays when reading files
Two paths missed setting up overlays:
  - `CompletionInstance` when checking files from dependencies
  - `SwiftASTManager` when reading in files that it would later replace
    all inputs with

(1) would cause the AST context not to be re-used, even though nothing
had changed. (2) caused all non-completion functionality to fail for any
symbols within files only specified by the overlay.

Resolves rdar://85508213.
2022-03-24 15:30:02 -07:00
swift-ci
71c8c33040 Merge pull request #41957 from mikeash/swift-self-inspect
[swift-inspect] Support forking corpses and self-inspection of the swift-inspect process on Darwin.
2022-03-24 12:48:06 -07:00
Mike Ash
43df54caee [swift-inspect] Support forking corpses and self-inspection of the swift-inspect process on Darwin.
Support inspecting the swift-inspect process itself. `pidFromHint` skips the process it's in, so we manually check the requested name against `argv[0]` as a special case.

Add a `--fork-corpse` flag which uses `task_generate_corpse` on the target task before inspecting it. This allows the target to keep running while we inspect it, and also works around a bug when self-inspecting.
2022-03-22 16:30:16 -04:00
Andrew Trick
406aa86d2e Merge pull request #41557 from atrick/addrlower-update
Update and reimplement AddressLowering pass (for SIL opaque values).
2022-03-21 22:15:06 -07:00
Mike Ash
8b51941b31 Merge pull request #41855 from mikeash/swift-inspect-locks
[RemoteMirror][swift-inspect] Decode locks in priority-escalation concurrency runtime.
2022-03-21 11:20:49 -04:00
Mike Ash
ae2b5140ed [RemoteMirror][swift-inspect] Decode locks in priority-escalation concurrency runtime.
When possible, decode the DrainLock/ExecutionLock fields of tasks and actors in concurrency runtimes built with priority escalation, and show the corresponding thread info in swift-inspect output.

We weren't properly decoding actor flags previously, so fix that up as well and have Remote Mirror split them out into separate fields so clients don't have to. We were missing the Job Storage field from the definition of DefaultActorImpl in RuntimeInternals.h, fix that so we actually read the right data.

rdar://88598003
2022-03-18 15:41:16 -04:00
Mike Ash
0b32adc9d9 [swift-inspect] Fix taskToThread dictionary on watchOS.
watchOS's 32-bit address types continue to cause trouble.

rdar://90489466
2022-03-18 12:44:54 -04:00
Keith Smiley
a61899f6d1 [swift-stdlib-tool] Add error for missing directories
In the case the user passes a directory that doesn't exist, this now
errors immediately instead of silently ignoring it.
2022-03-17 17:53:14 -07:00
Artem Chikin
9a9f796f9b Merge pull request #41844 from artemcm/TargetInfoCarefulJSON
Do not escape UNICODE when writing out target info.
2022-03-17 16:57:55 -07:00
Keith Smiley
fd7028d886 [swift-stdlib-tool] Reject invalid arguments
Previously any invalid flags were silently ignored.
2022-03-17 11:46:21 -07:00
Artem Chikin
57518b5894 Do not escape UNICODE when writing out target info.
Escaping unicode characters results in invalid JSON.

- Refactor writeEscaped routine into StringExtras

Resolves rdar://90108531
2022-03-16 15:30:21 -07:00
Victoria Mitchell
455cdbc5a7 use swift-cmark/gfm instead of /main 2022-03-16 14:56:21 -06:00
Mike Ash
9fd97d5b52 Merge pull request #41676 from mikeash/swift-inspect-concurrency-flags
[swift-inspect][RemoteMirror] Decode job/task/actor flags.
2022-03-16 10:21:40 -04:00
Mike Ash
5fd87a8ee3 [swift-inspect][RemoteMirror] Decode job/task/actor flags.
Have RemoteMirror internally decode these flags fields and return them as separate fields in the task/actor info. Handle the structures both with and without task escalation support.

Also show when a task is the current task on a thread in swift-inspect's task listing.

rdar://88598003
2022-03-14 16:20:05 -04:00
Konrad `ktoso` Malawski
13cc8b3157 [Distributed] Enable no-longer-experimental distributed by default 2022-03-11 22:14:49 +09:00
Andrew Trick
8a7e955b0d Move -enable-sil-opaque-value to SILOptions. 2022-03-09 17:18:15 -08:00