Commit Graph

7754 Commits

Author SHA1 Message Date
swift-ci
997ace439c Merge pull request #58562 from AnthonyLatsis/sr13589
Add regression test for #56024 crasher
2022-05-24 00:40:37 -07:00
swift-ci
afdfbb8e49 Merge remote-tracking branch 'origin/main' into rebranch 2022-05-23 16:33:12 -07:00
Pavel Yaskevich
321b741351 [TypeChecker] NFC: Add a test-case for issue#59031 (crash in ConjunctionStep::resume) 2022-05-23 14:12:25 -07:00
Nate Chandler
24979d48e0 [SSADestroyHoisting] Adopt new utilities.
Instead of doing one or two non-iterative BackwardReachability runs,
do a single run of IterativeBackwardReachability.  During that, pause
after discovery/local dataflow and use VisitBarrierAccessScopes to
determine which end_access instructions in the discovered region are
barriers.  Add those instructions as kills to the dataflow.  Finally run
the global dataflow.

Enables SSADestroyHoisting to hoist destroys over loops.

Addresses a correctness issue where access scopes which were open at
barrier blocks were not promoted to barriers, resulting in destroy_addrs
getting hoisted into unrelated access scopes.
2022-05-21 12:56:51 -07:00
Ben Barham
c163e0fe5e [Tests] Make OS features consistent
lit.py currently allows any substring of `target_triple` to be used as a
feature in REQUIRES/UNSUPPORTED/XFAIL. This results in various forms of
the OS spread across the tests and is also somewhat confusing since they
aren't actually listed in the available features.

Modify all OS-related features to use the `OS=` version that Swift adds
instead. We can later remove `config.target_triple` so that these don't
the non-OS versions don't work in the first place.
2022-05-20 19:51:23 -07:00
Ben Barham
36632cde49 [rebranch] Temporarily fix lit target_triple
Any substring of `target_triple` is allowed as a feature (when used in
REQUIRES/UNSUPPORTED/XFAIL) in `lit.py`. This is what allows eg. `XFAIL:
linux` even though `linux` isn't listed as an available feature.

`TARGET_TRIPLE` was renamed to `LLVM_TARGET_TRIPLE` upstream, so rename
it here as well. Going forward we should remove `target_triple` entirely
and use our `OS=...` features instead.
2022-05-18 16:29:46 -07:00
Egor Zhdan
d738a64b02 [cxx-interop] Do not run SIL/verify_all_overlays.py on std
rdar://93420692
2022-05-17 16:10:40 +01:00
Egor Zhdan
ff8464fd2a [cxx-interop] Add basic C++ stdlib overlay
This will allow us to add Swift conformances to C++ standard library types, and improve usability of the C++ standard library from Swift.
2022-05-16 13:30:35 +01:00
Alex Hoppen
49f8bdb019 [CodeCompletion] Add test cases that were fixed and had reduced reproducers
The following issues no longer reproduce on `main` and had reduced reproducers. Add them to the test suite.

- SR-12977
- SR-14691
- SR-15113
- rdar://63063279
- rdar://64227741
- rdar://69813796
- rdar://85609548
2022-05-13 15:49:08 +02:00
Luciano Almeida
3f8144c57f [Sema] Allow optional hole propagation in code completion mode 2022-05-11 23:23:46 -03:00
Slava Pestov
dac8d666ee Stop passing -requirement-machine-{abstract,inferred,protocol}-signatures flags in tests
These flags are now no-ops.
2022-05-10 12:56:17 -04:00
Slava Pestov
f39372b33d RequirementMachine: Turn off redundant requirement warnings by default and add -warn-redundant-requirements frontend flag 2022-05-10 01:49:56 -04:00
Slava Pestov
0111618c50 RequirementMachine: Perform concrete contraction on protocol requirement signatures 2022-05-09 21:21:35 -04:00
Robert Widmann
a7ed41d163 Merge pull request #58675 from CodaFi/some-nest-of-vipers
Ban Nested `some` Types in Existentials
2022-05-05 10:05:09 -07:00
Robert Widmann
930827aeb2 Ban Nested some Types in Existentials
We would like to leave room in the language for `some` types in existential
constraints a la `any P<some Q>` to resolve as a part of the requirement
signature of a future generalized existential type. To that end, usages of
`some` types nested anywhere in the arguments of an existential will fail to
resolve.

rdar://92758884
2022-05-04 19:21:32 -07:00
Pavel Yaskevich
8508e187c1 Merge pull request #58531 from xedin/rdar-92327807
[CSSimplify] Don't attempt to synthesize ~= for optional base types
2022-05-04 10:55:56 -07:00
Ben Barham
0627a20d5e [Test] Disable test to unblock CI 2022-05-03 13:57:53 -07:00
Ben Barham
4b56634d92 Merge pull request #58617 from etcwilde/ewilde/more-normal-utf8-chars
Use less exotic unicode chars
2022-05-03 11:06:15 -06:00
Alex Hoppen
eb8df860e8 Merge pull request #58522 from ahoppen/pr/no-circular-supertypes
[CodeCompletion] Avoid creating circles in the USRBasedType supertype hierarchy
2022-05-03 09:43:08 +02:00
Evan Wilde
70c92cab52 Use less exotic unicode chars
The characters used before were in the private-use section had surrogate
chars. This led to issues with some python utf8 decoder implementations
resulting in the error

```
UnicodeEncodeError: 'utf-8' codec can't encode characters in position
13-20: surrogates not allowed
```

This uses more normal utf8 characters that should hopefully work
everywhere while still exhibiting issues decoding to ascii.
2022-05-02 10:17:27 -07:00
Anthony Latsis
d470eaadad Add regression test for #56024 crasher 2022-05-01 06:21:48 +03:00
Evan Wilde
f0ba04e40e Merge pull request #58420 from etcwilde/ewilde/fix-python3-encoding
`line-directive` decode utf8 charset
2022-04-29 10:33:41 -07:00
Pavel Yaskevich
f0ba1a859a [CSSimplify] Don't attempt to synthesize ~= for optional base types
`EnumElement` patterns with optional base type do member lookup
on both optional type and its wrapped type but do not synthesize
`~=` operator call.

Resolves: rdar://92327807
2022-04-29 10:09:31 -07:00
Alex Hoppen
b4fca1a40e [CodeCompletion] Avoid creating circles in the USRBasedType supertype hierarchy
You would think that superclass + conformances form a DAG. You are wrong!
We can achieve a circular supertype hierarcy with

```swift
protocol Proto : Class {}
class Class : Proto {}
```

USRBasedType is not set up for this. Serialization of code completion results from global modules can't handle cycles in the supertype hierarchy
because it writes the DAG leaf to root(s) and needs to know the type offsets. To get consistent results independent of where we start
constructing USRBasedTypes, ignore superclasses of protocols. If we kept track of already visited types, we would get different results depending on
whether we start constructing the USRBasedType hierarchy from Proto or Class.
Ignoring superclasses of protocols is safe to do because USRBasedType is an under-approximation anyway.

rdar://91765262
2022-04-29 12:53:17 +02:00
Evan Wilde
edc30c3296 Add utf8 line-directive test 2022-04-28 18:26:45 -07:00
Pavel Yaskevich
1359840ab3 Merge pull request #58400 from xedin/too-complex-improvements
[ConstraintSystem] Improve precision of "too complex" diagnostic
2022-04-27 19:58:31 -07:00
Alex Hoppen
f652a9d01a Merge pull request #42295 from ahoppen/pr/add-fixed-test-cases
[IDE][Sema] Add test cases for issues no longer occurring in the stress tester
2022-04-27 11:32:44 +02:00
Pavel Yaskevich
7869b73a73 [TypeChecker] NFC: Add a "slow" perf test-case for rdar://91310777 2022-04-25 14:10:58 -07:00
Pavel Yaskevich
a40e8e80c1 [ConstraintSystem] Use affected range (if any) to diagnose 'too complex' failures 2022-04-25 14:09:45 -07:00
Pavel Yaskevich
e73ee93268 Merge pull request #42594 from xedin/rdar-92025732
[TypeChecker] NFC: Remove a literal to make test-case less flaky
2022-04-25 09:33:21 -07:00
Josh Soref
624a54b9cf Spelling stdlib (#42544)
* spelling: abcdefghijklmnopqrstuvwxyz

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: clazz

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: collection

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: compressible

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: constituent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: contiguous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: convertibility

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: element

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: enforce

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exhaustive

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exhausts

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: existential

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: facilitate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: ignored

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: incorporated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: intersection

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: laziness

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: misaligned

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: overhaul

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: preamble

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: precondition

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: replacement

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: trailing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unambiguous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: uncompressible

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: world

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-22 19:18:38 -07:00
Pavel Yaskevich
b8046e1064 [TypeChecker] NFC: Remove a literal to make test-case less flaky
Multi-statement closure + simd perf test-case still (albeit very
rarely) fails, so let's remove `/ 4` in attempt to prevent that
happening.

Resolves: rdar://92025732
2022-04-22 15:44:42 -07:00
Alex Hoppen
e0205f7586 [Sema] Add test case for SR-15497
SR-15497 is no longer happening in the stress tester. Add its test case to the test suite.

rdar://85602946
2022-04-22 09:50:24 +02:00
Alex Hoppen
0a79ab7637 [IDE] Add test case for SR-14708
SR-14708 is no longer happening in the stress tester. Add its test case to the test suite.

rdar://78781625
2022-04-22 09:50:24 +02:00
Pavel Yaskevich
384d508200 Merge pull request #42483 from xedin/rdar-90366182
[CSApply] Rewrite types of a constructed tuple
2022-04-21 10:00:40 -07:00
Pavel Yaskevich
ef4793e191 Merge pull request #42500 from xedin/rdar-91849144
[TypeChecker] NFC: Adjust SwiftUI to use %target-cpu instead of x86_64
2022-04-21 09:43:49 -07:00
Doug Gregor
3316cf01f7 Merge pull request #41996 from DougGregor/implicit-open-by-default
[SE-0352] Implicit opening of existentials by default
2022-04-20 21:37:52 -07:00
swift-ci
d0950d127a Merge pull request #42508 from nate-chandler/test/20220420/rdar85526879
[Test] Run more returned-as-async ObjC blocks.
2022-04-20 20:51:16 -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
Doug Gregor
c76a99ba02 [SE-0352] Enable implicit opening of existentials by default 2022-04-20 17:51:04 -07:00
nate-chandler
45ec725e43 Merge pull request #42485 from nate-chandler/rdar85526916
[SILGen] Use opaque AP for ObjC-async returns.
2022-04-20 16:43:02 -07:00
Nate Chandler
15ed62d5a7 [Test] Run more returned-as-async ObjC blocks.
Verify the recent fix at https://github.com/apple/swift/pull/42485.
2022-04-20 16:40:52 -07:00
Pavel Yaskevich
1c426a30d1 Merge pull request #42484 from xedin/drop-se-0326-flag
[TypeChecker] NFC: Remove `-experimental-multi-statement-closures` flag
2022-04-20 14:39:35 -07:00
Pavel Yaskevich
2b3661570f [TypeChecker] NFC: Adjust SwiftUI to use %target-cpu instead of x86_64
Resolves: rdar://91849144
2022-04-20 14:38:24 -07:00
Joe Groff
270d100b43 Merge pull request #42478 from asl/escape-c-pointer
[DebugInfo] Ignore noescape bit for all @convention(c) pointers
2022-04-20 12:58:31 -07:00
Nate Chandler
4aff98ffb5 [SILGen] Use opaque AP for ObjC-async returns.
Previously, the AbstractionPattern that was used for the value
"returned" (i.e. via a completion handler) from ObjC mostly (but not
quite always) was "type".

The generated completion handler correctly (because this is required in
order to call _resumeUnsafeContinuation) reabstracted the block (e.g.
from @convention(block) to @substituted <T> () -> @out T for <()>).  The
callee of the ObjC function, however, loaded the function from the block
as if it were not reabstracted (e.g. () -> ()).

On most platforms, that happened to work.  On arm64e, that difference in
types caused in a difference in pointer signing, resulting in a failure
at runtime.

rdar://85526879
rdar://85526916
2022-04-20 10:42:45 -07:00
Pavel Yaskevich
6db0001863 [TypeChecker] NFC: Remove -experimental-multi-statement-closures flag
SE-0326 has been enabled by default, so this flag is no longer necessary.
2022-04-20 10:40:27 -07:00
Pavel Yaskevich
879bd6578d [CSApply] Rewrite types of a constructed tuple
When construction call is rewritten into a tuple conversion,
rewriter has to make sure that AST types are reset otherwise
it would end up with types set by `packIntoImplicitTupleOrParen`
which could contain l-values.

Resolves: rdar://90366182
2022-04-20 10:35:06 -07:00
Doug Gregor
3f4bc7df37 Add -strict-concurrency=limited to one more test. 2022-04-20 09:11:10 -07:00
Anton Korobeynikov
121e28051a Force escaping all thin functions. Ensure types are always unique. 2022-04-20 10:34:45 +02:00