Commit Graph

7754 Commits

Author SHA1 Message Date
Holly Borla
a8cde123c5 Merge pull request #40925 from hborla/escaping-archetype-type-variables
[Sema] Construct `OpenedArchetypeType` with a canonical existential type.
2022-01-20 09:22:33 -08:00
Holly Borla
b3b24a78cd [Test] Add a compiler crasher test case for unsupported opened existential
types.
2022-01-19 22:53:59 -08:00
Slava Pestov
e4973158d8 AST: -debug-generic-signatures protocol-qualifies DependentMemberTypes 2022-01-19 22:36:15 -05:00
Alejandro Alonso
54ff7cfa2c Add availability around the indic sequence tests 2022-01-18 22:17:07 -08:00
Slava Pestov
5cd14952a2 Add regression test for fixed crasher - rdar://46714549 2022-01-16 22:17:15 -05:00
swift-ci
da38e8c3fe Merge pull request #40869 from nate-chandler/wrangle/20220114/1 2022-01-15 03:30:51 -08:00
Nate Chandler
1d939d4201 [Test] Run in right contexts.
The validation-test/SILOptimizer/lexical-lifetimes.swift test uses
concurrency features.  Specified where that means the test can run
appropriately.
2022-01-14 18:31:33 -08:00
Pavel Yaskevich
3b381f7876 [TypeChecker] NFC: Add a slow perf test related to operator >= 2022-01-13 12:13:16 -08:00
Slava Pestov
d6e0a9103a Merge pull request #40827 from slavapestov/subst-builtin-conformance
AST: Implement ProtocolConformance::subst() for BuiltinProtocolConformances
2022-01-13 00:00:35 -05:00
swift-ci
4fe523bc98 Merge pull request #40826 from nate-chandler/wrangle/20220112/1 2022-01-12 19:13:57 -08:00
Slava Pestov
e387e72a40 AST: Implement ProtocolConformance::subst() for BuiltinProtocolConformances
Fixes https://bugs.swift.org/browse/SR-15628 / rdar://problem/87094438
2022-01-12 16:55:49 -05:00
Nate Chandler
9b021c9ba7 [Test] Eased check assertion. 2022-01-12 13:15:57 -08:00
Slava Pestov
3a92d2fc53 AST: Remove legacy GSB-based GenericSignature query implementation 2022-01-12 12:33:34 -05:00
Alejandro Alonso
6ca7366cd8 Merge pull request #40746 from Azoy/indic-grapheme-clusters
[stdlib] Implement the Indic grapheme breaking rules
2022-01-11 12:50:02 -08:00
nate-chandler
79f9a5937a Merge pull request #40744 from nate-chandler/lexical_lifetimes/test/verification/20220105/1
[Test] Checked variable lifetimes extend self.
2022-01-10 14:16:48 -08:00
Pavel Yaskevich
9f7d3fccad Merge pull request #40708 from xedin/disable-multi-stmt-inference-inside-result-builder-bodies
[ConstraintSystem] SE-0326: Temporarily prevent multi-statement closure inference in result builder contexts
2022-01-06 01:04:22 -08:00
Alejandro Alonso
4a451829f8 Implement the Indic grapheme breaking rules 2022-01-05 16:18:54 -08:00
Nate Chandler
cb205a6ec0 [Test] Checked variable lifetimes not extend weak.
Verified that lexical lifetimes DO NOT result in a method call to a weak
reference resulting in a strong reference to the object.  Consequently,
even with lexical lifetimes enabled, it is still possible, within a
single scope, for the first method call to an object weakly referenced
to occur but for the second such call not to because the object will
have been deallocated.
2022-01-05 13:00:35 -08:00
Nate Chandler
f48f3ad228 [Test] Checked variable lifetimes extend self.
Verified that when a __consuming method calls a function which takes a
closure that captures self weakly, self is not deallocated until the
call returns.  (Note that this is a behavioral change from what occurs
when lexical borrow scopes are disabled; in that case, self is
deallocated before the call to the function.)
2022-01-05 12:12:01 -08:00
Kuba (Brecka) Mracek
2653b5b931 Propagate SWIFT_ENABLE_REFLECTION into validation-test tests (#40737) 2022-01-05 11:35:44 -08:00
Pavel Yaskevich
fe9224d6a8 [TypeChecker] NFC: Add a test-case for mixed SwiftUI + multi-statement closures
This test-case used to crash with multi-statement closure inference
enabled in result builder contexts.
2021-12-26 21:16:27 -08:00
Saleem Abdulrasool
d1bb98b11e Merge pull request #40625 from buttaface/droid-remove-icu
[android] Remove ICU build flags since that requirement was dropped in #40340
2021-12-23 09:31:05 -06:00
Alejandro Alonso
27ec10e8da Merge pull request #40181 from Azoy/testing-unicode-scalar-props
[test][stdlib] Beef up Unicode.Scalar.Properties testing
2021-12-21 23:06:41 -08:00
Kuba (Brecka) Mracek
663a6fb771 Introduce SWIFT_STDLIB_HAS_TYPE_PRINTING flag to remove the ability to print types at runtime (to save codesize) (#40649) 2021-12-21 17:47:54 -08:00
Alejandro Alonso
12d2e8f72d Mark UnicodeScalarProperties Darwin only for right now 2021-12-21 02:13:56 -08:00
Alejandro Alonso
edc5d88d17 Test the rest of the scalar properties
oops forgot to put this back in and 5.6
2021-12-20 15:15:07 -08:00
Butta
a3ea28ff19 [android] Remove ICU build flags since that requirement was dropped in #40340 2021-12-20 12:06:13 +05:30
Slava Pestov
aef6e7c1e6 Add CHECK: lines to explicitly verify some dodgy requirement signatures 2021-12-17 10:04:51 -05:00
swift-ci
2fc0e354e7 Merge pull request #40596 from CodaFi/label-and-slander 2021-12-16 16:40:34 -08:00
Robert Widmann
6f68210fb2 Use the API Name of Enum Parameters to Determine Coding Keys
Covers a missing case in codable synthesis for enums with argument
payloads that have internal and external labels. When the name of the
var decl is used, the internal name of the parameter becomes the key
instead of the API name. In this case, this causes an invalid reference
to an enum case with the internal name as an argument to be synthesized
in the derived Decodable conformance which (hopefully) crashes
downstream.

rdar://86339848
2021-12-16 13:02:35 -08:00
swift-ci
ad7abdcbc7 Merge pull request #40278 from atrick/fix-debuginfo 2021-12-15 16:14:50 -08:00
Andrew Trick
7fec04c8fb Fix a test case with copy-pasted SIL IDs. 2021-12-15 13:57:05 -08:00
Slava Pestov
01965d2c0d Merge pull request #40559 from slavapestov/typealias-in-protocol-fixes
Don't resolve protocol typealiases as DependentMemberTypes in Structural mode
2021-12-15 07:45:35 -05:00
Alejandro Alonso
b9b4e7516b Beef up Unicode.Scalar.Properties testing for binary properties 2021-12-14 21:02:55 -08:00
Slava Pestov
b32694e736 GSB: Try to avoid calling Type::subst() from expandConformanceRequirement() 2021-12-14 19:44:21 -05:00
Alejandro Alonso
90aa299bc2 Reenable some stdlib long_test 2021-12-14 12:29:33 -08:00
Slava Pestov
2441e688e4 Pass -requirement-machine-protocol-signatures=on in a few tests where the GSB got it wrong
These fail with -requirement-machine-protocol-signatures=verify because
the GSB produces incorrect output. Enable the requirement machine
unconditionally for these tests, bypassing verification.

A new file test/Generics/same_type_requirements_in_protocol.swift
contains reduced versions of all of the failures, with FileCheck
used to confirm the exact requirement signature output.
2021-12-14 02:17:51 -05:00
swift-ci
a77f161ec9 Merge pull request #38341 from 3405691582/FoundationInterop 2021-12-12 18:41:01 -08:00
swift-ci
6a752615d6 Merge pull request #40477 from nate-chandler/lexical-lifetimes/reenable-destroy-hoisting 2021-12-09 15:42:02 -08:00
Nate Chandler
59f3b37c35 [SIL] Reenable destroy hoisting under lexical lifetimes.
Until https://github.com/apple/swift/pull/40392 lands, run destroy
hoisting with lexical lifetimes.
2021-12-09 10:42:36 -08:00
Nate Chandler
ea42e2f334 Enabling copy propagation enables lexical lifetimes.
The effect of passing -enable-copy-propagation is both to enable the
CopyPropagation pass to shorten object lifetimes and also to enable
lexical lifetimes to ensure that object lifetimes aren't shortened while
a variable is still in scope and used.

Add a new flag, -enable-lexical-borrow-scopes=true to override
-enable-copy-propagation's effect (setting it to ::ExperimentalLate) on
SILOptions::LexicalLifetimes that sets it to ::Early even in the face of
-enable-copy-propagation.  The old flag -disable-lexical-lifetimes is
renamed to -enable-lexical-borrow-scopes=false but continues to set that
option to ::Off even when -enable-copy-propagation is passed.
2021-12-08 19:13:21 -08:00
Eric Miotto
403ccd4072 Extend freestanding to support targeting Darwin platforms (#40202)
* add an option to add freestanding to the Darwin platform, so that
  to get expected compile behaviours (e.g. setting the install name)
* rework testing configuration to relax assumptions about freestanding
* add a preset to test such configuration (at least for PR testing)

Addresses rdar://85465396
2021-12-08 07:09:44 -08:00
Nate Chandler
2356b07427 [Test] Add two lexical lifetime verification tests.
Verify that lexical-lifetimes and copy-propagation interact correctly to
keep objects named by variables alive in a couple interesting cases:
unsafe pointers, synchronization point calls.
2021-12-07 16:29:17 -08:00
Pavel Yaskevich
fecc887024 Merge pull request #40438 from xedin/rdar-85843677
[PreCheck] Don't use value declared in closure as outer candidate if …
2021-12-07 12:14:58 -08:00
eeckstein
307251a803 Merge pull request #40421 from eeckstein/remove-host-swiftlib-support
cmake: remove support for non-libswift swift support in host libraries/executables.
2021-12-07 09:32:30 +01:00
swift-ci
fe4d9af277 Merge pull request #40404 from nate-chandler/lexical_lifetimes/renamed_flag 2021-12-06 20:12:59 -08:00
Pavel Yaskevich
f642c3efc8 [PreCheck] Don't use value declared in closure as outer candidate if it's validated
With multi-statement closure inference enabled "outer candidates"
hack needs to be careful with its use of `isInvalid()` because some
of the declarations lookup finds might be coming from a multi-statement
closure that being type-checked, such declarations have to be avoided
as candidates, otherwise calling `isInvalid` on them results in a circular
type-checking.

Resolves: rdar://85843677
2021-12-06 16:47:56 -08:00
Erik Eckstein
6199876be7 cmake: remove support for non-libswift swift support in host libraries/executables.
This is not needed anymore because all swift code will be contained in libswift.
Also, remove the corresponding tests.
2021-12-05 19:06:00 +01: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
swift-ci
f443f22fe9 Merge pull request #40391 from nate-chandler/test/disable/20211203/1 2021-12-03 10:46:35 -08:00