Commit Graph

7628 Commits

Author SHA1 Message Date
Mishal Shah
1f48b2ca8f [Disabled] 1 BuildSystem test to support new version of Xcode 16.2 and macOS 15.2 https://github.com/swiftlang/swift/issues/79256 2025-02-09 20:03:58 -08:00
Mishal Shah
9f2ce02cfc [Disabled] 6 tests to support new version of Xcode 16.2 and macOS 15.2 https://github.com/swiftlang/swift/issues/79255 2025-02-09 20:01:27 -08:00
Erik Eckstein
d351d10845 tests: add a testfile for a predictable-memory-opt complexity problem.
Reported here: https://github.com/swiftlang/swift/issues/56221
rdar://72885279
2025-02-07 11:30:35 +01:00
Ian Anderson
517ced4f4b [ClangImporter][Tests] clang doesn't support the empty string as a path argument
SIL/verify_all_overlays.py is passing `-F ""` on non-Apple platforms. Swift handles that kind of, but clang doesn't support it and will get argument parsing errors. It's a pathological case, so fix SIL/verify_all_overlays.py to not do that, but also add a failsafe in ClangImporter to not pass on empty paths.

rdar://142441042
2025-02-03 13:06:32 -08:00
Pavel Yaskevich
d245dac784 Merge pull request #79086 from xedin/small-solver-perf-optimizations
[CSOptimizer] A few small performance optimizations
2025-01-31 21:20:50 -08:00
Pavel Yaskevich
72340f39b8 [CSOptimizer] Look through OptionalEvaluationExprs when dealing with unapplied disjunctions
This improves performance for situations like `a?.b + 2` by
giving a high score to `b` which prioritizes it over an operator.
2025-01-31 13:07:29 -08:00
Tim Kientzle
42f0b89f28 Merge pull request #79038 from tbkka/tbkka-rdar143402921-test
Test for #78981
2025-01-30 15:16:12 -08:00
Tim Kientzle
bf624b1461 Fine-tune what environments should run this test 2025-01-30 08:57:38 -08:00
Pavel Yaskevich
aff0f455cf Merge pull request #79026 from xedin/rdar-143474313
[CSBindings] Allow optional subtype inference when closure result is …
2025-01-30 00:37:46 -08:00
Pavel Yaskevich
f5158f8427 Merge pull request #79023 from xedin/rdar-143799118
[CSOptimizer] Disjunctions with IUO overload choices are unsupported
2025-01-30 00:37:33 -08:00
Tim Kientzle
f48f772396 Test for #78981
**Without #78981**: This test triggers "Reflection section too small to contain next record"
errors, indicating that the field information is broken.

**With #78981**: This test runs to completion without triggering
the error message above.
2025-01-29 18:52:17 -08:00
Arnold Schwaighofer
ed3a6d1090 verify_all_overlays.py : This test blocks the nightly toolchain and the failure is being worked on
Temporarily disable it.

rdar://143050566
2025-01-29 13:30:28 -08:00
Pavel Yaskevich
c922ab5634 [CSBindings] Allow optional subtype inference when closure result is not yet resolved
Similar to `Void?` we need to unwrap `$T?` because it could be later
bound to `Void` from context.

Resolves: rdar://143474313
2025-01-29 13:12:56 -08:00
Pavel Yaskevich
471ee21535 [CSOptimizer] Disjunctions with IUO overload choices are unsupported
They form a follow-up disjunction to determine whether force unwrap
is necessary and `getEffectiveType` cannot handle that.

Resolves: rdar://143799118
2025-01-29 10:36:16 -08:00
Alastair Houghton
40185a47c8 Merge pull request #78858 from al45tair/eng/PR-143050566
[Tests] Enable C++ interop for _Backtracing in the overlay verification test.
2025-01-28 22:33:50 +00:00
Dario Rexin
0587075839 Merge pull request #78890 from drexin/wip-143429827
[Runtime] Add compatibility override support for CVW runtime functions
2025-01-28 10:33:52 -08:00
Alastair Houghton
100f2615cb [Tests] Enable C++ interop for Runtime in the overlay verification test.
The Runtime module requires C++ interop enabled, because that's
the only way to robustly fix things so that it is able to declare various
types and constants without clashing with system headers.

To make this work, we also need to add a missing invocation to sil-opt to
make it pick the correct C++ runtime library.

rdar://143050566
2025-01-28 14:21:50 +00:00
Alastair Houghton
ab8e561583 Merge pull request #78516 from al45tair/eng/PR-124913332
[Backtracing] Implement API per SE-0419
2025-01-28 10:48:33 +00:00
Dario Rexin
e15bdc132c [Runtime] Rename CVW entry points for compatibility 2025-01-27 15:43:01 -08:00
Erik Eckstein
172f3caf85 tests: make tests more resilient to optimizations by passing values to _blackHole
Without `_blackHole`, the optimizer may remove or make assumptions about values, which are not intended by the test.
This fixes the tests when running them in optimize mode and when OSSA modules are enabled.

This is part of rdar://140229560.
2025-01-27 10:38:30 +01:00
Erik Eckstein
66e801b0e8 tests: fix lifetimes of objects in two tests
Those tests rely on lexical object lifetimes. But lifetimes are only guaranteed for "variables" but not for temporary objects.
Storing those objects in variables fixes the issue.

This fixes the tests when running them in optimize mode and when OSSA modules are enabled.

This is part of rdar://140229560.
2025-01-27 10:38:30 +01:00
Tim Kientzle
674c76274e Merge pull request #77062 from tbkka/tbkka-remotemirror-133890406
Let indirect enum cases export spare bits
2025-01-24 19:52:59 -08:00
Allan Shortlidge
0b0d2e912c AST: Only apply MemberImportVisibility to lookups from the main module.
MemberImportVisibility rules should only apply to source code in the main
module. The rules were being applied when resolving witnesses for synthesized
Hashable conformances on CF types imported by ClangImporter, which caused the
lookups to fail and bad conformances to be generated.

Resolves https://github.com/swiftlang/swift/issues/78870 and rdar://142433039.
2025-01-23 21:11:18 -08:00
Anthony Latsis
499146df88 Merge pull request #78739 from AnthonyLatsis/hatzegopteryx
TypeCheckType: Rework IUO diagnostics using behavior limitation
2025-01-22 19:12:02 +00:00
Anthony Latsis
35f1370f6e TypeCheckType: Rework IUO diagnostics using behavior limitation
Also stop suggesting a '?' fix-it for casts, where it is not likely to
be helpful because the common intention is either to force the optional
or declare an IUO.
2025-01-21 21:41:00 +00:00
Alejandro Alonso
11fbd94668 Merge pull request #78664 from Azoy/unicode-16
[stdlib] Unicode 16
2025-01-21 09:29:35 -08:00
Alastair Houghton
760cc57bef [Backtracing] Rename _Backtracing to Runtime.
Move the backtracing code into a new Runtime module.  This means renaming
the Swift Runtime's CMake target because otherwise there will be a name
clash.

rdar://124913332
2025-01-17 10:09:36 +00:00
Slava Pestov
cfcc73f164 Sema: Add -solver-disable-splitter flag for debugging
We're not planning on removing the splitter because it is a big win
in some cases, but we want to run it less often since it can also
be a source of overhead. This flag allows us to compare performance
to understand the tradeoffs better.
2025-01-15 22:30:33 -05:00
Alejandro Alonso
708d72d2c3 Update tests for 6.1 Unicode 16 stdlib 2025-01-15 14:09:57 -08:00
Hiroshi Yamauchi
1d8e48dcf7 Merge pull request #78563 from hjyamauchi/issue78447
Add a reproducer for issue 78447
2025-01-15 10:56:06 -08:00
Hiroshi Yamauchi
7abb94a5f4 Add a reproducer for issue 78447
https://github.com/swiftlang/swift/issues/78447
2025-01-13 11:28:44 -08:00
Pavel Yaskevich
84c7188219 Merge pull request #78526 from xedin/issue-78371
[CSOptimizer] Literal arguments should cause score reset only for operators
2025-01-13 08:59:36 -08:00
Pavel Yaskevich
e3987beffb [CSOptimizer] Literal arguments should cause score reset only for operators
Resetting score to `0.1` is intended to make sure that the
solver picks the outermost disjunction in literal chains like
`1 + 2 + 3 ...` because that would provide context to the
inner choices.

Resolves: https://github.com/swiftlang/swift/issues/78371
Resolves: rdar://142105691
2025-01-09 11:28:24 -08:00
Anthony Latsis
28160c9d09 Merge pull request #78049 from AnthonyLatsis/nelumbo-lutea
build: Unhardcode Swift source directory name
2025-01-09 11:23:17 +00:00
Pavel Yaskevich
8e3943c4c1 Merge pull request #78506 from xedin/disable-swiftui-test-due-to-141262107
[Tests] NFC: Disable a test-case to unblock update to Xcode 16.2
2025-01-09 00:13:25 -08:00
Pavel Yaskevich
8b4a809482 [Tests] NFC: Disable a test-case to unblock update to Xcode 16.2 2025-01-08 16:07:02 -08:00
Alexis Laferrière
a046a0d6b7 Tests: Disable verify_all_overlays on Linux platforms 2025-01-07 11:59:53 -08:00
Anthony Latsis
4a5e0daa9d build: Unhardcode Swift source directory name
This is useful if you maintain several swift worktrees that reside in
the source root directory.
2025-01-07 09:58:47 +00:00
Pavel Yaskevich
5cac7dba79 Merge pull request #78357 from xedin/too-complex-with-count
[CSOptimizer] Few tweaks to make unapplied disjunction and literal array arguments faster
2025-01-03 00:20:40 -08:00
Hamish Knight
4e33cef20c [AST] Walk into LocatableType in TypeWalker
Make sure we walk into the underlying type for
LocatableType.
2025-01-02 15:02:11 +00:00
Pavel Yaskevich
cfd34e54c4 [CSOptimizer/Tests] NFC: Add a perf test-case fixed by improved literal array handling 2024-12-30 10:20:57 -08:00
Pavel Yaskevich
8a304f88c6 [CSOptimizer] Extend candidate/parameter matching to support array literals
Match `[...]` to Array<...> and/or `ExpressibleByArrayLiteral`
conforming types. This is very helpful for expressions like:
`[...] + [...]`.
2024-12-25 12:51:01 -08:00
Pavel Yaskevich
0737542da8 [CSOptimizer] Favor choices that don't require application
When disjunction is not applied, don't only bump its score
but also favor all of the choices that don't require application
because selection algorithm uses that for comparison.

This is important for situation when property is overload with
a method i.e. `Array.count`.
2024-12-24 17:12:36 -08:00
Pavel Yaskevich
443d011feb [Tests] NFC: Restrict SIMD related perf test to macOS to make it more stable 2024-12-20 10:33:17 -08:00
Slava Pestov
d3f736972b Merge pull request #78304 from slavapestov/too-complex-tests
Add formerly-slow expressions found by building projects from the Swift package index
2024-12-20 09:55:34 -05:00
Henrik G. Olsson
ef9d2b744d Rename pointer bounds (#78210)
* Make pointer bounds non-experimental

* Rename @PointerBounds to @_SwiftifyImport

* Rename filenames containing PointerBounds

* Add _PointerParam exception to stdlib ABI test

* Add _PointerParam to stdlib API changes

* Rename _PointerParam to _SwiftifyInfo
2024-12-20 11:36:01 +01:00
Slava Pestov
8d0d9577f6 Add formerly-slow expressions found by building projects from the Swift package index
These were slow in 6.0 and are now fast(er).
2024-12-19 17:26:16 -05:00
Pavel Yaskevich
19350d9737 Merge pull request #63585 from xedin/solver-perf
[CSSolver] Implementation of disjunction choice favoring algorithm
2024-12-18 09:47:59 -08:00
Pavel Yaskevich
bc3a15fbe6 [CSOptimizer] Disable CGFloat -> Double conversion for unary operators
Some of the unary operators, i.e. prefix `-`, don't have
CGFloat variants and expect generic `FloatingPoint` overload
to match CGFloat type. Let's not attempt `CGFloat` -> `Double`
conversion for unary operators because it always leads
to a worse solutions vs. generic overloads.
2024-12-18 00:22:49 -08:00
Pavel Yaskevich
636525ebd9 Merge pull request #78171 from xedin/rdar-140300022
[TypeChecker/SILGen] Allow `any Sendable` to match `Any` while matching generic arguments
2024-12-17 20:24:34 -08:00