Commit Graph

7628 Commits

Author SHA1 Message Date
Alex Hoppen
e56708c84f [CodeCompletion] Fix crash when completing inside a protocol that inherits from other protocol with extension
rdar://119408961
2023-12-13 14:27:50 -08:00
Slava Pestov
335d6ffea1 Frontend: Add -disable-experimental-associated-type-inference flag 2023-12-08 13:39:10 -05:00
Slava Pestov
e29c3a90aa AST: Lazily populate associated conformances with -enable-experimental-associated-type-inference 2023-12-07 19:27:59 -05:00
Slava Pestov
b1ed3c270c Add regression tests for rdar://116434843 and #59772 2023-12-07 19:27:59 -05:00
Erik Eckstein
8fb002e009 tests: add a missing target-codesign in constant_folded_fp_operations.swift
rdar://119268917
2023-12-07 09:45:02 +01:00
Kavon Farvardin
df8367604d Merge pull request #70161 from kavon/test-coverage-rdar118360449
[test] add coverage for rdar://118360449
2023-12-01 15:19:51 -08:00
Kavon Farvardin
5672ddfb31 [test] add coverage for rdar://118360449 2023-12-01 10:02:16 -08:00
Pavel Yaskevich
dde501485e [CSBinding] Prefer array literal type over a disjunction in certain cases
If array literal type is not delayed and doesn't have any type variables
associated with it, let's prefer it over a disjunction to facilitate
type propagation through its `Element` type to element expressions.

Resolves: rdar://118993030
2023-11-30 17:43:13 -08:00
Pavel Yaskevich
2701d431cf [CSBindings] Prefer key path type over a disjunction if key path is resolved
If key path type has bindings and is no longer delayed it means
that it's fully resolved and ready to be bound (even though value
type might not be resolved yet).
2023-11-30 16:26:10 -08:00
eeckstein
2c43c273f9 Merge pull request #69828 from jkshtj/main
[sil-optimizer] Add FP comparison support in constant folder
2023-11-28 06:59:52 +01:00
Kshitij
cc3c51ecb9 [sil-optimizer] Don't constant fold eq comparisons b/w inf and non-inf
This commit modifes the constant folder to not handle equality comparisons b/w
infinity and non-infinity operands. In such comparisons, special floating point
types - Float80 and Float16, may come into play and pattern matching againt them
complicates the constant folding logic more than we'd like.
2023-11-27 11:32:28 -08:00
Kshitij
c800dd731f [sil-optimizer] Add validation tests for constant folded FP arithmetic 2023-11-27 11:32:28 -08:00
Kshitij
97a5a83ae6 [sil-optimizer] Add FP comparison support in constant folder 2023-11-27 11:32:28 -08:00
Alex Hoppen
423826f742 [CodeComplete] Add test case for #57148, #57149
The issue no longer occurs on `main`. Add a test case for it.

Fixes #57148
Fixes #57149
2023-11-23 18:01:03 -08:00
Pavel Yaskevich
79ac431780 Merge pull request #69742 from xedin/transitive-keypath-base-inference
[ConstraintSystem] More changes to key path inference
2023-11-14 17:31:14 -08:00
Slava Pestov
e65290c2bd Sema: Associated type inference skips witnesses that might trigger a request cycle
This implements a structural walk over the TypeRepr to catch
situations where we attempt to infer `A` from `func f(_: A)`,
which references the concrete `A` that will be synthesized
in the conforming type.

Fixes:
- rdar://34956654 / https://github.com/apple/swift/issues/48680
- rdar://38913692 / https://github.com/apple/swift/issues/49066
- rdar://56672411
- https://github.com/apple/swift/issues/50010
- rdar://81587765 / https://github.com/apple/swift/issues/57355
- rdar://117442510
2023-11-14 12:08:59 -05:00
Ben Barham
9ea3146904 Merge pull request #69564 from finagolfin/early-driver
[Build] Enable building the early Swift Driver on linux with the prebuilt host toolchain
2023-11-09 14:36:27 -08:00
Pavel Yaskevich
9f21b95fcb [CSDiagnostics] A tailored diagnostic when passing key path as an argument to non-key path parameter
Produce a tailored diagnostic that omits a fully unresolved key path
type (`KeyPath<_, _>`) when key path without an explicit root type is
passed as an argument to non-keypath parameter type (i.e. `Int`).
2023-11-08 19:54:32 -08:00
Alejandro Alonso
3deacf8944 Fix backwards iteration of word breaking 2023-11-08 13:26:20 -08:00
Finagolfin
a03f6e5b3a [Build] Enable building and CI testing the early Swift Driver on linux with the prebuilt host toolchain 2023-11-08 20:09:59 +05:30
Anthony Latsis
da6dff3ef5 Merge pull request #68713 from AnthonyLatsis/test-generate-xcode 2023-11-03 23:57:20 +03:00
Nate Chandler
cea0f00598 [InstructionDeleter] Delete dead load [take]s.
Previously, `isScopeAffectingInstructionDead` determined that
an otherwise satisfactory `load` was not dead if it was a `load [take]`.
The immediate effect was that dead `load [take]`s were not deleted.  The
downstream effect was that otherwise dead graphs of instructions would
not be deleted.  This was especially a problem for OSLogOptimization
which deletes a great deal of code.

Here, the InstructionDeleter is taught to compensate for the deletion of
such `load [take]` by inserting `destroy_addr`s in their stead.

rdar://117011668
2023-11-01 14:42:28 -07:00
Pavel Yaskevich
e4f0d69954 Merge pull request #69418 from xedin/rdar-112095973-test
[TypeChecker] NFC: Add test-case for rdar://112095973
2023-10-26 14:00:34 -07:00
Nate Cook
2c244b9698 Fix precondition in UMRBP.initialize(as:fromContentsOf:)
This precondition checks to make sure that the content-providing
collection isn't larger than the allocated buffer, but was preventing
using a buffer that is the exact same size as the collection.
2023-10-25 17:17:36 -05:00
Pavel Yaskevich
863058757d [TypeChecker] NFC: Add test-case for rdar://112095973 2023-10-25 14:58:11 -07:00
Tim Kientzle
5d4c29cd09 Fix a bunch of reflection tests to be correct for Ubuntu
These tests had Darwin-specific code in them, mostly unnecessary,
that caused them to break on non-Darwin platforms.

Only one (reflect_Enum_SingleCaseCFPayload.swift) was actually
specific to Darwin.  That one has been disabled.  For the rest,
just delete the unnecessary `import Darwin` and similar.
2023-10-24 06:58:41 -07:00
Kavon Farvardin
0f2a8d5ea7 bump number of diags in 0161-issue-49119.swift
Seems we already emit 6 duplicate diagnostics for this test, so what's
one more?

I'm not sure what change I made triggered this additional diagnostic.
2023-10-18 20:02:17 -07:00
Pavel Yaskevich
23701bbb6d Merge pull request #69174 from xedin/rdar-116122902
[CSDiagnostics] Adjust how requirement failures anchor type is computed
2023-10-17 21:08:36 -07:00
Pavel Yaskevich
4c38d72230 [Tests] NFC: Add a FIXME about use of <<error type>> in a diagnostic 2023-10-16 12:37:54 -07:00
Erik Eckstein
54d254f100 Optimizer: better handling of the complexity budget in redundant-load-elimination and dead-store-elimination.
Instead of having a budget for each optimized load or store, provide a budget for the whole function.
Fixes a build time problem.

rdar://116877696
2023-10-16 14:44:34 +02:00
Pavel Yaskevich
a90bd1cbe1 [Tests] NFC: Add a test-case for rdar://116122902 2023-10-13 10:50:15 -07:00
Yuta Saito
e52b155a9c [test] Disable multithreading tests on threading_none 2023-10-11 18:14:43 +00:00
Yuta Saito
4c8dc5bcb8 [test] Replace obsolete single_threaded_runtime feature with threading_none
The feature was renamed in 0cf687aa2b but
validation tests were not updated at that time.
2023-10-11 18:14:43 +00:00
Tim Kientzle
8bb3a55702 [RemoteInspection] Allow enums to be trivial even with a formal payload
A "trivial" enum is one that carries no information.
The previous logic asserted that a trivial enum had only one
case and that case had no payload.
But this is also a trivial payload:
```
// Trivial, so zero-sized
enum MyFormatVersion {
  case v4
}
// Also trivial, since the payload carries no information
enum Format {
  case MyFormat(MyFormatVersion)
}
```

This commit adds a test case similar to the above
and corrects the assertions for trivial enums to
assert that there is either no payload, or that the
payload is zero-sized.

Resolves rdar://116406504
2023-10-03 14:06:12 -07:00
Kuba Mracek
884bd6e173 [embedded] Adjust verify_all_overlays.py to avoid checking Cxx and CxxStdlib 2023-09-26 23:02:14 -07:00
Anthony Latsis
2644adf2b0 [NFC] Delete redundant RUN line in test 2023-09-26 16:32:29 +03:00
Anthony Latsis
5e50aa5d08 [NFC] Add lit test for Xcode project generation 2023-09-26 16:32:27 +03:00
Tim Kientzle
06896074c5 Merge pull request #68634 from hjyamauchi/enum-multipayload-generic-empty
Account for the generic zero-sized payload enum cases.
2023-09-25 14:43:37 -07:00
Anthony Latsis
17fc2d200e build-script: Don't emit build commands for LLVM when --build-llvm set to false 2023-09-23 14:10:05 +03:00
Holly Borla
940ab81244 Merge pull request #68685 from hborla/minimize-constraint-system-isolation-checking 2023-09-22 07:31:45 -07:00
Holly Borla
2e9c64d36c [Concurrency] Do not allow actor isolation violations in function conversions
to impact constraint solving.
2023-09-21 19:44:03 -07:00
Hiroshi Yamauchi
ed58501ecd Account for the generic zero-sized payload enum cases.
Disable the assert:

    // At least one payload is non-empty (otherwise this                                                                                                                  // would get laid out as a non-payload enum)                                                                                                                          assert(getNumNonEmptyPayloadCases() > 0);

in TaggedMultiPayloadEnumTypeInfo because it fails when you have
generic but zero-sized payload enum cases.

Also remove unnecessary "REQUIRES: objc_interop" lines from the enum
reflection tests.
2023-09-21 09:31:24 -07:00
Alex Hoppen
9b31e9a69f Merge pull request #68595 from ahoppen/ahoppen/batch-completion
[tests] Add a `%batch-code-completion` lit substitution
2023-09-20 17:26:09 -07:00
Erik Eckstein
09b443d9e3 IRGen: fix emission of constant single-case enums without payload
This is a follow-up of https://github.com/apple/swift/pull/68516 which didn't handle the no-payload case correctly

Fixes a compiler crash

rdar://115666971
2023-09-19 10:28:51 +02:00
Alex Hoppen
a5a17aa955 [tests] Add a %batch-code-completion lit substitution
I could never remember the command to run batch code completion tests. Add a lit substitution for it.
2023-09-18 13:57:49 -07:00
Erik Eckstein
9cf0229824 IRGen: fix emission of constant single-case enums
Enums which have a single case with a payload were emitted with wrong field alignement into the data section.

Fixes a miscompile:
rdar://115251963
2023-09-14 12:17:06 +02:00
Hamish Knight
97c3275f6b Add missing %target-codesigns to a couple of tests 2023-09-12 14:45:51 +01:00
Erik Eckstein
885f267362 tests: increase timeout of large_nested_array test
It fails on some jobs intermittently

rdar://115165160
2023-09-11 12:08:47 +02:00
Nate Chandler
d239a14f12 [Test] Required executable_test in executing test.
rdar://115169839
2023-09-08 07:08:59 -07:00
nate-chandler
57e56a0a9e Merge pull request #68342 from nate-chandler/gh68328
[MoveChecker] Complete lifetimes before checking.
2023-09-07 12:20:09 -07:00