Commit Graph

7604 Commits

Author SHA1 Message Date
swift-ci
00cd798510 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-18 13:45:51 -07:00
Allan Shortlidge
082f0ac4b5 Tests: Use a more natural spelling for ABI triple lit substitutions.
`%target-swift-5.8-abi-triple` instead of `%target-swift-abi-5.8-triple`, for
example.
2024-10-18 10:11:36 -07:00
swift-ci
1df3ffb7cb Merge remote-tracking branch 'origin/main' into rebranch 2024-10-17 09:12:58 -07:00
Tim Kientzle
5bd2c4b93c Merge pull request #77027 from tbkka/tbkka-remotemirror-classexistential
Fix multi-payload enums with Class Existential payloads on 32-bit targets
2024-10-17 08:57:38 -07:00
Tim Kientzle
3abefd1dda Accomodate x86_64 vs. arm64 differences 2024-10-17 08:51:47 -07:00
Tim Kientzle
fe90ad5684 Let indirect enum cases export spare bits
To determine the correct enum layout, we first count various
categories of cases.  Before, we counted indirect generic cases as
"generic", but regular "generic" cases can't export spare bits.

Change this to count "indirect" cases as a separate category.
In particular, this ensures that fully-indirect enums use
spare bits from the pointers even when some or all of the cases
are generic.

Resolves rdar://133890406
2024-10-16 18:31:28 -07:00
Tim Kientzle
502941ca5a More arcana about MPEs carrying class existentials
The first word in a class existential is the class pointer itself.
This pointer exposes spare bits differently depending
on the platform, which becomes apparent when you try to reflect
an Optional carrying such an MPE.

Add new test cases and some logic to zero out the first
word of spare bit information only on platforms with 8-byte pointers.
2024-10-16 16:06:37 -07:00
swift-ci
0462851544 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-16 09:56:16 -07:00
nate-chandler
b5e3f42cad Merge pull request #77044 from nate-chandler/rdar137960229
[DiagnoseUnreachable] Ignore dead_end destroys.
2024-10-16 09:41:48 -07:00
Nate Chandler
ce368e8220 [DiagnoseUnreachable] Ignore dead_end destroys.
Such destroys mark the lifetime end of their operands along their
availability boundary.  They are currently inserted in this test case
by the ClosureLifetimeFixup pass, but in the fullness of time they will
be present for every value which is not explicitly destroyed (that's
what complete OSSA lifetimes is mostly about).

Currently, such destroys are diagnosed by DiagnoseUnreachable.  Fix the
diagnostic pass not to diagnose these valid instructions.

rdar://137960229
2024-10-15 21:00:16 -07:00
Tim Kientzle
a105cf5323 Fix multi-payload enums with Class Existential payloads on 32-bit targets
Class existentials expose spare bits from all of the pointers, not just the first one.
Due to a bad bug here, we were properly exposing spare bits from the first pointer,
but then claiming that all bits of subsequent pointers were spare.
This accidentally resulted in the correct operation on 64-bit targets
(it picked the highest-order spare bit, which happened to be spare
in both the broken mask and the correct mask).  But on 32-bit targets,
this exposed the high-order bits of pointers, which is incorrect.

Expand the test a bit while we're here as well.

Resolves rdar://132715829
2024-10-15 09:28:01 -07:00
swift-ci
b4f1024467 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-13 07:34:41 -07:00
Rintaro Ishizaki
8e8e4d0193 [Parse/Sema] Move OptionalEvaluationExpr wrapping to PreCheckTarget
This simplify the Parser diagnostics and some type checker logic.
2024-10-11 13:12:48 -07:00
swift-ci
24c3b5e002 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-07 17:15:46 -07:00
Mike Ash
ceb2853948 [Test] Temporarily disable reflect_Enum_values10 test on ARM64_32.
This test hits a bug on ARM64_32, disable it temporarily until we can fix it.
2024-10-07 16:16:07 -04:00
swift-ci
dee3d90d16 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-30 11:16:46 -07:00
Nate Chandler
350aaa4d39 [Test] Mark unsupported for OS stdlib.
The test verifies a stdlib behavior whose fix is not present in all
OSes.

rdar://136943907
2024-09-30 07:14:54 -07:00
swift-ci
4b2c2235c0 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-27 11:16:06 -07:00
nate-chandler
79b0a7cf78 Merge pull request #76739 from nate-chandler/rdar136388508_2
[Test] Added regression test.
2024-09-27 11:02:08 -07:00
Nate Chandler
03e101813d [Test] Added regression test. 2024-09-26 16:20:09 -07:00
Guillaume Lessard
03d9d04c2e [test] Test sendability of POSIXErrorCode 2024-09-24 13:11:26 -07:00
swift-ci
415b83acd6 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-24 05:54:22 -07:00
Hamish Knight
bbb04aaa20 [test] Disable bridging PCH in a few tests
The new driver builds a PCH by default, which the
old driver didn't do. These tests don't expect a
PCH, so avoid building it.
2024-09-22 21:15:45 +01:00
Hamish Knight
345619e9cb [test] Remove a test for linking against libraries in the resource dir
This is no longer a behavior we have in the new driver
(swiftlang/swift-driver#733).
2024-09-22 19:40:06 +01:00
swift-ci
5e0b892e9e Merge remote-tracking branch 'origin/main' into rebranch 2024-09-20 13:09:36 -07:00
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
swift-ci
f7d72cb78f Merge remote-tracking branch 'origin/main' into rebranch 2024-09-20 05:14:28 -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
swift-ci
6053b50742 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-19 21:34:21 -07: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
swift-ci
4b00b512c1 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-19 21:14:03 -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
swift-ci
dbad48cb7f Merge remote-tracking branch 'origin/main' into rebranch 2024-09-17 08:55:31 -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
swift-ci
17d5ec2432 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-17 00:15:49 -07:00
Meghana Gupta
e6fc5c2e6d Delete SWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES flag 2024-09-16 14:08:16 -07:00
Ben Barham
a7b50f357f Merge remote-tracking branch 'origin/main' into manual-main-merge
Conflicts:
  - `lib/Driver/ToolChains.cpp` conflicting with the `addAllArgs` rename
    for multiple options
2024-09-16 13:53:18 -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
swift-ci
faf388d87d Merge remote-tracking branch 'origin/main' into rebranch 2024-09-08 20:35:18 -07: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