Commit Graph

7628 Commits

Author SHA1 Message Date
Ben Barham
65ed78d3e7 Merge branch 'main' into manually-merge-main 2022-06-02 10:14:57 -07:00
Alex Hoppen
4aa2bbbf06 Revert "Merge pull request #42447 from al45tair/eng/PR-90776105"
This reverts commit 8bcb71140f, reversing
changes made to c4dd271d36.
2022-06-02 18:03:23 +02:00
Joe Groff
b7fd963b79 Merge pull request #59213 from jckarter/keypath-aeic
SILGen: Don't reference external property descriptors for @_alwaysEmitIntoClient properties.
2022-06-02 08:45:10 -07:00
Joe Groff
53e8e7b1d8 SILGen: Don't reference external property descriptors for @_alwaysEmitIntoClient properties.
Their definition is fully visible to clients to be copied into them, and there isn't necessarily
a symbol for the property descriptor in the defining module, so it isn't necessary or desirable to
try to use a property descriptor with them. Trying to reference the descriptor leads to missing
symbol errors at load time when trying to use keypaths with older versions of the defining dylib,
which goes against the purpose of `@_alwaysEmitIntoClient` meaning "no ABI liabilities for the
defining module". Fixes rdar://94049160.
2022-06-01 16:54:38 -07:00
Alastair Houghton
8bcb71140f Merge pull request #42447 from al45tair/eng/PR-90776105
[Build][Runtime] Add a new threading library.
2022-06-01 12:57:23 -07:00
swift-ci
10222c2489 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-01 10:13:44 -07:00
Alejandro Alonso
c59f47389f Add Script and Script Extension tests (#59194) 2022-06-01 09:55:09 -07:00
swift-ci
b455bd1924 Merge remote-tracking branch 'origin/main' into rebranch 2022-05-27 22:14:10 -07:00
Josh Soref
0f78f006bb Spelling validation test (#58561) 2022-05-27 22:07:10 -07:00
swift-ci
f9a274d6fc Merge remote-tracking branch 'origin/main' into rebranch 2022-05-27 19:12:49 -07:00
Doug Gregor
686655b61f Update expected diagnostics 2022-05-27 14:46:30 -07:00
swift-ci
3b41d5f9d1 Merge remote-tracking branch 'origin/main' into rebranch 2022-05-25 16:14:04 -07:00
Ben Barham
efc9469444 Merge pull request #58975 from bnbarham/make-features-consistent
[Tests] Make OS features consistent
2022-05-25 16:02:43 -07:00
Ben Barham
92b6dd24c2 Merge branch 'main' into manually-merge-main 2022-05-25 15:55:35 -07:00
Robert Widmann
663722d892 Parameterized Existential Types Are Enabled By Default
See https://forums.swift.org/t/accepted-se-0353-constrained-existential-types/57560
2022-05-25 09:50:36 -07:00
Alex Hoppen
e2012dddf3 Merge pull request #41314 from ahoppen/pr/build-lld
[build-script] Add option to build lld as part of LLVM
2022-05-25 07:58:54 +02:00
Pavel Yaskevich
8fd8408075 [CSSimplify] If function types mismatch on labels record a contextual mismatch
`RelabelArguments` cannot possibly diagnose this issue because there
are no argument lists in this case. Let's report contextual mismatch
instead.

Resolves: https://github.com/apple/swift/issues/59058
2022-05-24 16:58:43 -07:00
swift-ci
89b4b5df26 Merge remote-tracking branch 'origin/main' into rebranch 2022-05-24 10:13:48 -07:00
Nate Chandler
e39caea26a [Test] Run test with 64-bit SIL on 64-bit arch. 2022-05-24 08:03:11 -07:00
Alastair Houghton
63a09007a1 [Threading] Create new threading library and use it.
Moved all the threading code to one place.  Added explicit support for
Darwin, Linux, Pthreads, C11 threads and Win32 threads, including new
implementations of Once for Linux, Pthreads, C11 and Win32.

rdar://90776105
2022-05-24 14:57:39 +01:00
Alastair Houghton
dadcb04ae2 [Build][Runtime] Replace SWIFT_STDLIB_SINGLE_THREADED_RUNTIME.
SWIFT_STDLIB_SINGLE_THREADED_RUNTIME is too much of a blunt instrument here.
It covers both the Concurrency runtime and the rest of the runtime, but we'd
like to be able to have e.g. a single-threaded Concurrency runtime while
the rest of the runtime is still thread safe (for instance).

So: rename it to SWIFT_STDLIB_SINGLE_THREADED_CONCURRENCY and make it just
control the Concurrency runtime, then add a SWIFT_STDLIB_THREADING_PACKAGE
setting at the CMake/build-script level, which defines
SWIFT_STDLIB_THREADING_xxx where xxx depends on the chosen threading package.

This is especially useful on systems where there may be a choice of threading
package that you could use.

rdar://90776105
2022-05-24 14:57:38 +01:00
swift-ci
522d42475e Merge remote-tracking branch 'origin/main' into rebranch 2022-05-24 03:33:13 -07:00
nate-chandler
2978bf0750 Merge pull request #58791 from nate-chandler/rdar92545900
[SSADestroyHoisting] Handle loops.
2022-05-24 03:17:34 -07:00
swift-ci
68542f3707 Merge remote-tracking branch 'origin/main' into rebranch 2022-05-24 00:54:46 -07:00
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