Commit Graph

3327 Commits

Author SHA1 Message Date
Dave Lee
b6b477de58 [Debug] Add pointer based stringForPrintObject (#84742)
Adds an overload of `_DebuggerSupport.stringForPrintObject` which takes a pointer and mangled typename as arguments. This will be used to improve performance and resilience of `po` in lldb.

The pointer and mangled typename are used to construct an `Any` value, which is then passed into the primary implementation of `stringForPrintObject`.

This allows calling `stringForPrintObject` without having to first construct a context that contains all necessary Swift modules. This will improve speed, and also resilience when modules cannot be loaded for whatever reason.

rdar://158968103
2025-11-18 09:32:28 -08:00
Mishal Shah
60d09fff62 Merge pull request #85315 from swiftlang/count-mixup
Make sure we don't compare too many bytes if a non-native string being compared to a native one has the same utf16 count but a different utf8 count
2025-11-05 16:35:28 -08:00
David Smith
a23ed0dd7a Most ridiculous possible test mistake 2025-11-04 20:31:42 -08:00
David Smith
b4118a2b40 Fix test oversight 2025-11-04 13:00:28 -08:00
David Smith
e7ba16381c Make sure we don't compare too many bytes if a non-native string being compared to a native one has the same utf16 count but a different utf8 count 2025-11-04 11:43:43 -08:00
Jai
d9383e6aa5 Fix crash when accessing span of empty InlineArray (#85268)
Fix crash when creating a Span from an empty InlineArray whose storage
is only byte-aligned. #85265.

---------

Co-authored-by: Guillaume Lessard <glessard@tffenterprises.com>
2025-11-04 10:15:24 -05:00
Mike Ash
b01436d67b Merge pull request #85222 from mikeash/client-retain-release-no-weak-defs
[Runtime] Avoid weak definitions for client retain/release.
2025-10-31 20:01:45 -04:00
Ben Barham
c97838654e Merge pull request #84833 from jamieQ/obs-macro-ii
[Observation]: fix @Observable macro producing invalid code with certain comments
2025-10-31 14:49:27 -07:00
Guillaume Lessard
82d66e3884 Merge pull request #85201 from glessard/rdar158735546-again 2025-10-30 19:20:24 -07:00
Mike Ash
f3b0dbb2ad [Runtime] Avoid weak definitions for client retain/release.
Instead of using weak definitions of swift_retain_preservemost and swift_release_preservemost, use weak references and explicitly check them for NULL.

Embedded Swift uses weak definitions for its runtime symbols. If swiftCore is able to override the weak definitions of the _preservemost functions, it will also override the Embedded symbols. They are not compatible, so this ends poorly.
2025-10-30 15:11:06 -04:00
Guillaume Lessard
4b96f38864 Adjust test to be more resilient regarding inlining. 2025-10-29 17:38:15 -07:00
Mike Ash
94e32d8eda [Test] Fix ABI and symbol visibility tests for client retain/release.
The client retain/release changes introduced new symbols which need to be added to these tests.

rdar://163578648
2025-10-29 09:45:18 -04:00
Jamie
21b57f7856 [fix][Observation]: further attempts to resolve macro expansion
interaction with comments

Adds logic to insert newlines in various places to try and resolve the
fact that the current expansion produces invalid code in some cases
depending on comment location. Adds some basic tests of the expansion
output.
2025-10-25 20:39:43 -05:00
Alejandro Alonso
74a09351d2 Merge pull request #85071 from Azoy/fix-keypath-append
[stdlib] Add the intermediate type size for every leaf component
2025-10-22 18:32:02 -07:00
Henrik G. Olsson
782af00eb0 Merge pull request #84926 from ramonasuncion/test-stdlib-dev-stderr
[Test][stdlib] Remove cat command for lit compatibility
2025-10-22 15:24:36 -07:00
Alejandro Alonso
714fd26830 Add the intermediate result for every leaf component 2025-10-22 13:00:55 -07:00
Ryan Mansfield
c314fc1582 Merge pull request #84296 from rjmansfield/emit-verbose-asm
Add frontend option -verbose-asm to emit verbose assembly.
2025-10-17 12:40:42 -04:00
Henrik G. Olsson
8320cbad68 Merge pull request #84671 from ramonasuncion/test-stdlib-kvokeypaths-filecheck
[Test][stdlib] Update KVOKeyPaths.swift to use --check-prefixes
2025-10-16 11:27:50 -07:00
Ramon Asuncion
496fb661cd [Test][stdlib] Remove cat command for lit compatibility 2025-10-16 09:01:27 -07:00
Ramon Asuncion
343b86a228 [Test][stdlib] Use /dev/stderr for lit compatibility 2025-10-15 13:27:43 -07:00
Ramon Asuncion
1c600005c4 [Test][stdlib] Remove DONT-CHECK fallback 2025-10-13 07:50:03 -07:00
Ramon Asuncion
01008dac42 [Test][stlib] Use conditional grep to enable CHECK-51 assertions 2025-10-13 07:49:12 -07:00
Jonathan Grynspan
5846e8f6a4 Add Equatable and Hashable conformance to GUID. (#84792)
On Windows, `GUID` is a currency type and (along with its various
typedefs) is used pervasively Windows offers `IsEqualGUID()` and
`UuidHash()` for comparing and hashing them, respectively, but
`IsEqualGUID()` is a macro in C mode and `UuidHash()` only provides a
16-bit hash. We should provide conformance to these protocols in the
WinSDK overlay to provide equivalent functionality in Swift.
2025-10-10 08:34:34 -04:00
Ryan Mansfield
4cc2940619 Add frontend option -verbose-asm to emit verbose assembly.
This enables the option by default to aid readability with
-emit-assembly.
2025-10-08 16:01:13 -04:00
Henrik G. Olsson
d3214de950 Merge pull request #84685 from hnrklssn/verify-all
This adds the -verify-ignore-unrelated flag. When -verify is used without -verify-ignore-unrelated, diagnostics emitted in buffers other than the main file and those passed with -verify-additional-file (except diagnostics emitted at <unknown>:0) will now result in an error. They were previously ignored. The old behaviour is still available as opt-in using -verify-ignore-unrelated, but by being strict by default it should make it harder to accidentally miss diagnostics.

To avoid unnecessary performance overhead, -verify-additional-file is still required to parse the expected-* directives in files other than the main file.
2025-10-06 18:01:47 -07:00
Philippe Hausler
229c36e476 Revert "[Observation] ensure event triggers on deinitialization passes as if all properties that are being observed have changed (for weak storage) (#79823)" (#83436)
This reverts commit 9d1d917091.
2025-10-06 12:50:27 -07:00
Henrik G. Olsson
cbc0ec3b88 Add -verify-ignore-unrelated where necessary (NFC)
These are tests that fail in the next commit without this flag. This
does not add -verify-ignore-unrelated to all tests with -verify, only
the ones that would fail without it. This is NFC since this flag is
currently a no-op.
2025-10-04 14:19:52 -07:00
Ramon Asuncion
54f5f746b0 [Test][stdlib] Remove obsolete i386 UNSUPPORTED directive
The test was disabled on i386 because of
https://github.com/swiftlang/swift/issues/52252.
That bug is fixed, so the comments can be removed.
2025-10-03 16:11:08 -07:00
Ramon Asuncion
d947259ebf [Test][stdlib] Update KVOKeyPaths.swift to use --check-prefixes 2025-10-03 10:28:13 -07:00
Alejandro Alonso
6017659337 Merge pull request #83161 from Azoy/keypath-overaligned-arguments
[stdlib] Handle arguments with alignment larger than a word in KeyPath
2025-10-02 07:25:55 -07:00
Artem Chikin
0aa5beeb30 Merge pull request #84539 from milseman/better_test
Adjust test to be more resilient w.r.t. inlining.
2025-09-29 11:18:11 -04:00
Michael Ilseman
2815cf9322 Adjust test to be more resilient w.r.t. inlining. 2025-09-26 10:48:11 -06:00
Guillaume Lessard
d806ee1060 Merge pull request #84386 from glessard/rdar160885820
[stdlib] fix MutableSpan’s Sendable conformance
2025-09-23 21:06:50 -07:00
Guillaume Lessard
0828ec920b [test] Span family Sendability 2025-09-23 15:40:33 -07:00
Guillaume Lessard
073d545267 [test] Sendability of MutableSpan 2025-09-23 15:27:16 -07:00
Alejandro Alonso
9933d3ccb2 Update KeyPath.swift 2025-09-13 14:59:19 -07:00
Alejandro Alonso
f95e9e4ee4 Correctly handle alignment and appending keypaths
Add test for overaligned keypath arguments
2025-09-13 14:59:17 -07:00
Egor Zhdan
6f0ab5dce8 Merge pull request #83914 from egorzhdan/egorzhdan/guiddef
[WinSDK] Modularize `<guiddef.h>`
2025-09-09 16:24:23 +01:00
Guillaume Lessard
77f7f42545 Merge pull request #83980 from glessard/rdar159026055-implementation-guard
[test] adjust backdeployment testing for bridged arrays
2025-09-02 11:15:21 -07:00
Stephen Canon
534690b1da Don't run this test in backdeployed / host stdlib configs (#83958)
libswiftOSLogTestHelper is built with add_swift_target_library, which is
used for runtime components, and we only support building those for
13.0+. These back-deploy bots are meant to test against the OS's
libraries, since that's what's actually used when back-deploying, but
that's not right for this library.

resolves rdar://159026163
2025-09-02 13:31:23 -04:00
Yuta Saito
3f96cef3a4 [wasm] Add support for __builtin_va_list type mapping (#84029)
Cover all va_list family of types just aliased by __builtin_va_list, including __isoc_va_list from wasi-libc. This enables proper C interop for variable argument functions on WASI targets.

Close https://github.com/swiftlang/swift/issues/72398
2025-09-02 14:36:33 +01:00
Egor Zhdan
28f9db7bfa [WinSDK] Modularize <guiddef.h>
This fixes modularization errors that arise when importing a C++ header that contains `#include <guiddef.h>`, which might hijack this header from the WinSDK module where it belongs.
2025-08-28 22:21:55 +01:00
Guillaume Lessard
833ed3c662 [test] adjust backdeployment testing 2025-08-28 10:37:07 -07:00
Doug Gregor
3782db5ce1 Small fixes for typed throws in withUnsafeTemporaryAllocation 2025-08-26 17:09:07 -07:00
Doug Gregor
e96e1746bb Adopt typed throws in withUnsafeTemporaryAllocation
The interior wrapping in Result<T, U> is a little unfortunate, but is
currently necessary because we end up with extra stack allocations
along the error-handling path in a do..catch that aren't there when
using untyped throws. We can simplify the implementation if we can
eliminate the extraneous stack allocation.

Fixes rdar://134973620.
2025-08-26 13:06:48 -07:00
Guillaume Lessard
c9a3fdf722 Merge pull request #83771 from glessard/rdar158440246 2025-08-16 02:40:16 -07:00
Guillaume Lessard
42337d3724 [test] removeAll() from an empty OutputSpan 2025-08-15 17:24:06 -07:00
Mykola Pokhylets
89f8f8b9bf Wrap only changes related to the closure frontend logic 2025-08-02 20:24:46 +02:00
Mykola Pokhylets
ae48446716 Wrap SE-0481 into an upcoming feature until source incompatibilities are resolved 2025-08-02 20:24:21 +02:00
Allan Shortlidge
1d9e085197 AST: Re-baseline NonescapableTypes feature. 2025-07-31 10:21:55 -07:00