Commit Graph

7303 Commits

Author SHA1 Message Date
Tim Kientzle
5d5627ae82 Merge pull request #76586 from tbkka/tbkka-enum-with-CF
Better support CoreFoundation types in RemoteMirror
2024-09-20 13:09:26 -07:00
Erik Eckstein
60e7346b87 tests: re-enable SILOptimizer/string_switch.swift
And fix the check lines.

(the test was disabled in https://github.com/swiftlang/swift/pull/76592)

rdar://136304425
2024-09-20 09:30:30 +02:00
Mishal Shah
5fb9583f0c Merge pull request #76592 from nate-chandler/rdar136304425
[Test] Disable test blocking Linux PR testing.
2024-09-19 21:24:17 -07:00
nate-chandler
01157bf292 Merge pull request #76578 from nate-chandler/rdar136267186
[Test] Add regression test.
2024-09-19 21:08:29 -07:00
Nate Chandler
9b00df3ba0 [Test] Disable test blocking Linux PR testing.
rdar://136304425
2024-09-19 17:37:39 -07:00
Tim Kientzle
025143138d Update an existing test that now works 2024-09-19 16:25:41 -07:00
Tim Kientzle
e62560c9ca Limit this part to only 64-bit targets 2024-09-19 14:04:11 -07:00
Tim Kientzle
da5383c4c3 Better support CoreFoundation types in RemoteMirror
This plugs a hole where we failed to recognize a CF type when it
appeared as the payload of an enum stored as a property.  Curiously,
RemoteMirror is able to reflect this when the enum appears by itself,
just not when it's stored as a property.

The simplest fix is to hook into the TypeInfo calculation which
computes a TypeInfo (basically, the tree of fields) from a TypeRef
(basically, the name of the type, including generic context).
Specifically, we sometimes end up here with a "type alias" that
none of the lookup support seems to be able to handle.  Fortunately,
these aliases demangle into a pretty predictable shape, so this
just pattern-matches the specific demangle tree shape to recognize
these as "type aliases in the `__C` module whose name starts with `CF`
and ends with `Ref`".

Resolves rdar://82465109
2024-09-19 13:50:41 -07:00
Nate Chandler
653d7b36e0 [Test] Add regression test.
For rdar://136267186 .
2024-09-19 11:29:13 -07:00
Pavel Yaskevich
afcf38e76d Merge pull request #76487 from xedin/fix-invalid-binding-elision
[CSBindings] Prevent `BindingSet::isViable` from dropping viable bindings
2024-09-17 08:44:20 -07:00
Meghana Gupta
e6fc5c2e6d Delete SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES flag 2024-09-16 14:08:16 -07:00
Pavel Yaskevich
2c9d05991f [CSBindings] Prevent BindingSet::isViable from dropping viable bindings
I think the original idea was to elide `Array<$T>` if there is
a binding a resolved generic arguments i.e. `Array<Float>`, but
the check doesn't account for the fact that bindings could be
of different kinds and there are some implicit conversions that
could be missed if we remove the bindings.

For example, given the following constraints:

`Array<$T0> conv $T1`
`$T1 conv Array<(String, Int)>`

`$T0` can be a supertype of `Array<$T0>` and subtype of `Array<(String, Int)>`.

The solver should accept both types as viable bindings because the
`$T0` could be bound to `(key: String, value: Int)` and that would
match `Array<(String, Int)>` conversion.
2024-09-16 09:54:12 -07:00
Slava Pestov
6fb66db6da Merge pull request #76318 from slavapestov/favored-over-disjunction-heuristic
Sema: Generalize heuristic in favoredOverDisjunction()
2024-09-14 08:45:09 -04:00
Pavel Yaskevich
c49aeaf177 Merge pull request #76354 from xedin/improve-mismatch-diagnostics-in-optional-context
[CSSimplify] Rework how/when mismatches between optional types are fixed
2024-09-11 10:14:19 -07:00
Pavel Yaskevich
55b8d9538d [CSSimplify] Rework how/when mismatches between optional types are fixed
- Don't attempt to insert fixes if there are restrictions present, they'd inform the failures.

  Inserting fixes too early doesn't help the solver because restriction matching logic would
  record the same fixes.

- Adjust impact of the fixes.

  Optional conversions shouldn't impact the score in any way because
  they are not the source of the issue.

- Look through one level of optional when failure is related to optional injection.

  The diagnostic is going to be about underlying type, so there is no reason to print
  optional on right-hand side.
2024-09-10 10:35:05 -07:00
Jan
6236b258d2 [Sema] Fixes for mutability handling in property wrappers (#76357)
Prevents a crash when a parameter references an invalid property wrapper. The original code assumed that mutability information would always be available, but this assumption fails when the property wrapper is invalid

Resolves https://github.com/swiftlang/swift/issues/65640
2024-09-10 00:20:29 -07:00
Slava Pestov
73aa029a8b Sema: Generalize heuristic in favoredOverDisjunction() 2024-09-09 11:18:58 -04:00
Hamish Knight
ee0e408a8c [Sema] Remove separate closure type-checking logic
`participatesInInference` is now always true for
a non-empty body, remove it along with the separate
type-checking logic such that empty bodies are
type-checked together with the context.
2024-09-08 16:17:11 +01:00
Hamish Knight
72fe29f7f4 [CS] Add custom diagnostic for missing result builder element
If we have a single missing argument for an empty
`buildBlock` call, emit a custom diagnostic.
2024-09-08 16:17:11 +01:00
Allan Shortlidge
c04736f75f Merge pull request #76276 from tshortli/remove-valid-triples-for-zippering-assertion
SILGen: Remove triplesAreValidForZippering() assert
2024-09-05 12:03:06 -07:00
Allan Shortlidge
4c3a009c2b SILGen: Remove triplesAreValidForZippering() assert.
This assert was correctly catching the fact that `-target-variant` is not being
normalized at the same time as `-target` when building arm64e modules from
swiftinterface. That should be fixed, but at the moment it isn't causing any
concrete harm and the assertion fails when building against the SDKs included
with the latest Xcode 16 betas.

Resolves rdar://133020098.
2024-09-04 22:39:21 -07:00
Slava Pestov
a3c0e225a7 Merge pull request #76238 from slavapestov/existential-signature-rework-part-3
Allow type variables to appear inside opened existential archetypes
2024-09-04 14:53:18 -04:00
Pavel Yaskevich
f9e08bc6ec Merge pull request #76174 from xedin/remodel-constraint-generation-for-assignment
[ConstraintSystem] Introduce `LValueObject` constraint to replace direct l-value assignments
2024-09-04 09:27:59 -07:00
Slava Pestov
5a43d2403e Sema: Simplify opened existential types in solution 2024-09-04 10:42:19 -04:00
Hamish Knight
3b0d692b30 [test] Restrict complete_sdk_platform.swift to macOS
rdar://135232586
2024-09-04 10:26:23 +01:00
Hamish Knight
142daacd61 [test] Re-enable expectation in complete_sdk_platform.swift
rdar://134963605
2024-09-03 18:40:51 +01:00
Hamish Knight
350c1ce771 Merge pull request #76222 from hamishknight/xfactor
[test] NFC: Factor out `%xcode-extra-platform-search-paths`
2024-09-03 18:21:39 +01:00
Hamish Knight
4f1bebf598 [test] NFC: Factor out %xcode-extra-platform-search-paths 2024-09-03 14:19:59 +01:00
Erik Eckstein
6c46d03601 tests: reduce the timeout of SILOptimizer/large_nested_array.swift.gyb again
It turns out that some CI jobs need 5-6 minutes for this test. To give some slack, use a timeout of 10 minutes.

This is a follow-up of https://github.com/swiftlang/swift/pull/76146
2024-09-03 09:26:31 +02:00
nate-chandler
9ee877943e Merge pull request #76186 from nate-chandler/rdar133779160
[ODL] Handle builtins.
2024-08-30 21:54:08 -07:00
Nate Chandler
5d9802f25f [ODL] Handle builtins.
No update is needed for the values they produce.  This pass should
really be refactored not to crash on instructions that aren't explicitly
listed or at least not to compile if not every instruction is listed.

rdar://133779160
2024-08-30 16:09:11 -07:00
Pavel Yaskevich
dab01bc1fe [Tests] NFC: Update some of the changed/improved tests 2024-08-30 15:39:25 -07:00
Hamish Knight
17b143cd99 Merge pull request #76156 from hamishknight/fix-test
[test] Temporarily remove a check from complete_sdk_platform.swift
2024-08-30 02:23:36 +01:00
Ben Langmuir
d94bce7355 Merge pull request #76027 from benlangmuir/explicit-targets
[test] Add explicit targets to tests depending on the default
2024-08-29 14:25:05 -07:00
Hamish Knight
51dcc9e0b9 [test] Temporarily remove a check from complete_sdk_platform.swift 2024-08-29 22:19:05 +01:00
Ben Langmuir
7d11d43d6d [test] Add explicit targets to tests depending on the default
Add specific deployment target versions to some tests that need to test
10.x-specific behaviours and are currently depending on the default
deployment target.

Certain tests were only checking either the stable or unstable ABI
depending on the platform the test was running. In those cases I doubled
up the checks so that we would test both cases on platforms that
supported it. This might use a bit of extra time on targets that only
support the stable ABI, but it seemed worth it for the additional
coverage in CI.
2024-08-29 07:55:14 -07:00
Mike Ash
eead3fa921 [Test] Temporarily increase large_nested_array.swift.gyb timeout to 2400 seconds while we investigate timeouts in CI. 2024-08-29 09:07:52 -04:00
nate-chandler
c56a313d6c Merge pull request #76114 from nate-chandler/rdar133969821_2
[DAH] Bail on pointer use if ignoring barriers.
2024-08-27 21:57:39 -07:00
Nate Chandler
74c4bc9c55 [DAH] Bail on pointer use if ignoring barriers.
Unknown uses of raw pointers should not result in bailing out when an
address is lexical--the destroy of the address will already not be
hoisted over any instructions which may access pointers.  If the address
is not lexical however (such as any address when lexical lifetimes are
disabled), that rationale does not apply, so unknown uses of raw
pointers must cause hoisting to bail.

rdar://133969821
2024-08-27 16:18:39 -07:00
Erik Eckstein
c1c3f76885 tests: fix SILOptimizer/rdar114699006.swift after a mangling change
Also enable this test for all 64 bit platforms, like arm64
2024-08-27 20:04:37 +02:00
Hamish Knight
940f5f7c2a [AST] Treat platform modules as non-user
Modules defined within the SDK are considered
non-user modules, extend this to any module found
within the parent platform directory if there is
one. This ensures we include modules such as
XCTest and Testing.

rdar://131854240
2024-08-23 14:23:37 +01:00
Alex Hoppen
8edb57c756 Merge pull request #75667 from ahoppen/build-issues-live-issues
[Sema/SourceKit] Emit same diagnostics for missing protocol requirements on the command line and in SourceKit
2024-08-07 17:24:47 -07:00
Slava Pestov
2925d4659b Merge pull request #75756 from slavapestov/fix-issue-74569
SIL: Fix signature of reabstraction thunk involving parameterized existential
2024-08-07 20:14:03 -04:00
Alex Hoppen
66104395d7 [Sema/SourceKit] Emit same diagnostics for missing protocol requirements on the command line and in SourceKit
Some editors use diagnostics from SourceKit to replace build issues. This causes issues if the diagnostics from SourceKit are formatted differently than the build issues. Make sure they are rendered the same way, removing most uses of `DiagnosticsEditorMode`.

To do so, always emit the `add stubs for conformance` note (which previously was only emitted in editor mode) and remove all `; add <something>` suffixes from notes that state which requirements are missing.

rdar://129283608
2024-08-07 14:01:30 -07:00
Slava Pestov
de16ed8d27 SIL: Fix signature of reabstraction thunk involving parameterized existential
Fixes https://github.com/swiftlang/swift/issues/74569
Fixes rdar://problem/130402282
2024-08-07 15:25:52 -04:00
Ryan Mansfield
35fb08790b Use num_extra_inhabitants_64bit to fix reflect_CheckedContinuation.swift and
reflect_UnsafeContinuation.swift on non-Darwin platforms.
2024-08-06 16:05:55 -04:00
Holly Borla
93191020bc Merge pull request #75687 from hborla/sendable-param-diagnostics
[Concurrency] Split up the non-`Sendable` diagnostics and improve wording.
2024-08-05 21:21:33 -07:00
Holly Borla
7dbec846f7 [NFC] Update a few tests for concurrency diagnostics changes. 2024-08-05 17:26:07 -07:00
Tim Kientzle
1aae57a93f Suppress these tests under "asan", not "ASAN" 2024-08-05 14:24:23 -07:00
Tim Kientzle
661f368c6b Merge pull request #75620 from tbkka/tbkka-remotemirror-checkedcontinuation
Basic test for RemoteMirror reflecting checked continuations
2024-08-05 11:33:28 -07:00