Commit Graph

269 Commits

Author SHA1 Message Date
Mike Ash 23fac72075 Merge pull request #88933 from mikeash/remote-mirror-inline-array
[Reflection] Support inspection of InlineArray.
2026-05-14 19:53:11 -04:00
Augusto Noronha cd4e937294 [RemoteInspection] Handle lowering existential constrained metatype
RemoteInspection was failing to produce type info for metatypes of
constrained existentials (any SomeType<ConstraintHere>.Type)

A constrained existential has the same layout as a regular protocol
composition, so we can use that instead.

rdar://176586637
2026-05-08 17:58:03 -07:00
Mike Ash 2bcfe0b092 [Reflection] Support inspection of InlineArray.
Report the array count as NumFields, and report the same info for each child since InlineArray is homogeneous.

rdar://176382725
2026-05-07 14:39:05 -04:00
Augusto Noronha c0da3a8e8a Merge pull request #88770 from augusto2112/fix-unamanged-pointer
[RemoteInspection] Fix rebuildStorageTypeInfo for unmanaged types
2026-05-04 20:04:55 -07:00
Finagolfin 4f13d0addb [test][android] Temporarily disable new Reflection/availability_custom_domains.swift test
Likely related to lld linker issues we've seen with other Reflection tests with
NDK 28, will probably work with the upcoming NDK 30.
2026-05-03 19:21:08 +05:30
Allan Shortlidge b0ed294c6e Merge pull request #88764 from tshortli/custom-availability-enum-element-reflection
IRGen: Skip emitting reflection metadata for enum elements that don't exist at runtime
2026-05-02 11:53:28 -07:00
Allan Shortlidge 31b5e3e0a7 IRGen: Skip reflection metadata for enum elements that don't exist at runtime.
The names of enum elements that are made unavailable at runtime via custom
availability conditions shouldn't leak through Swift's reflection metadata.
Don't emit the names into the metadata.  These enum elements should really be
skipped entirely for layout and tag generation, but that's a riskier change
that will need to come later.

Resolves rdar://175803941.
2026-05-02 06:45:27 -07:00
Augusto Noronha 32e8e96979 [RemoteInspection] Treat ObjC class metatypes as thick
Also adds a reflection test covering an ObjC class metatype stored as a
struct field.

assisted-by: claude

rdar://175382517
2026-04-30 17:01:37 -07:00
Augusto Noronha 5f36f9e71a [RemoteInspection] Fix rebuildStorageTypeInfo for unmanaged types
rebuildStorageTypeInfo only handled ReferenceTypeInfo and
RecordKind::ClassExistential inner types for unmanaged_storage, but
failed for imported unmanaged types which are imported behind a
pointer (which is a struct).

rdar://175379963
2026-04-30 14:45:33 -07:00
finagolfin 8c692ea543 [android][test] Switch tests that are failing with NDK 28 to XFAIL (#88499)
We're getting the next LTS NDK 30 ready, some of these can be re-enabled
after that.
2026-04-17 21:36:19 +05:30
Kavon Farvardin c18fa1b4b7 Test: XFAIL reflection test on FreeBSD 2026-04-03 11:36:24 -07:00
finagolfin 7eb94c9204 [test][android] Fix one test and disable others for NDK 28 and API 24 (#88056)
This fixes the failing IRGen test after
swiftlang/swift-docker#528 and bring those disabled tests for NDK 28
here instead.
2026-03-24 12:39:04 -07:00
Joe Groff ce605004f2 Reflection: Support for Builtin.Borrow.
Plumb the `BitwiseBorrowable` and `AddressableForDependencies` layout
properties through reflection TypeLowering, and implement type layout
for `Builtin.Borrow` based on those properties.
2026-02-13 10:03:48 -08:00
Erik Eckstein d5e0d5be4f tests: xfail -> unsupported Reflection/capture_descriptors.sil on freebsd
This test started to pass. Let's just disable it for freebsd to remove the flakiness
rdar://168080107
2026-01-14 08:45:46 +01:00
Adrian Prantl 75bee892be Add LLDB and swift-reflection-dump support for WebAssembly
This patch adds parsing and extracting of the Swift reflection
metadata data segments from within the WebAssembly DATA section and
tests it using swift-reflection-dump. This is needed to allow LLDB to
acces Swift reflection metadata when attached to WebAssembly
processes.

rdar://159217213
2025-08-27 17:14:17 -07:00
Evan Wilde 5eb727b668 Merge pull request #83908 from etcwilde/ewilde/freebsd-disable-known-failures
FreeBSD: Disable known/in-progress test failures
2025-08-27 10:30:53 -07:00
Evan Wilde dfccee66ad FreeBSD: Disable missing reflection metadata tests
LLD relocates some of the metadata sections resulting in bad offsets at
runtime.

The workaround is to pass `-no-rosegment` to the linker invocation.

rdar://159139154
2025-08-25 15:32:33 -07:00
Slava Pestov 831043c132 IRGen: Fix crash trying to emit capture descriptor involving element archetype
We could encode local archetypes in reflection info by performing the
local archetype transform, to get an extended generic signature together
with substitutions for the added generic parameters.

However, for now, let's just not crash. This generalizes an earlier hack
for opened existential archetypes. Instead of replacing them with
nonsensical type parameters though, let's just not emit the whole
descriptor.

- Fixes https://github.com/swiftlang/swift/issues/83539.
- Fixes rdar://157554723.
2025-08-25 12:42:49 -04:00
Augusto Noronha 50de07ab8f Enable two reflection tests on Linux (aarch64)
With the changes in b6ce889c8d, these
might be fixed.
2025-07-18 16:22:26 -07:00
Augusto Noronha b6ce889c8d [RemoteMirrors] Fix losing the remote address on StaticMirror
The Offset field of a DynamicRelocation is either an offset or a remote
address, but was being treated only as a remote address on
getDynamicSymbol.
2025-07-11 16:33:19 -07:00
finagolfin b2f52524c5 [android] Disable a couple Reflection tests and fix an install path (#82620)
The tests broke on the community Android CI since #82325, and I just
noticed the install issue when cross-compiling Testing with a
freshly-built compiler, which I'd never done before. Also, fix the NDK
path shown in the CMake output.
2025-07-02 09:41:59 +05:30
Mike Ash cef762bcf9 [Test] Disable chained fixups for typeref_decoding_asan.swift.
ObjectFileContext doesn't currently support chained fixups. We previously disabled chained ifxups in some other reflection tests but not this one.

rdar://137532051
2025-05-20 12:24:24 -04:00
Slava Pestov 70b413dc56 RemoteInspection: Support for parameter packs 2025-05-09 14:49:37 -04:00
Hamish Knight bc5c8f51bd [test] Fix extension macros in test suite
Make sure we're using `providingExtensionsOf` as the extended type,
previously we were just using the unqualified name of the decl.
2025-03-28 21:35:59 +00:00
Mike Ash 10feb11d27 [Test] Disable chained fixups when building a few reflection tests.
ObjectFileContext doesn't currently support chained fixups. For now, avoid building the test binaries with chained fixups to avoid issues.

This adds a %no-fixup-chains substitution which resolves to -Xlinker -no_fixup_chains on Darwin, and to nothing on everything else.

rdar://145442500
2025-02-25 13:54:42 -05:00
Stefan Gränitz 76243a25db [windows][toolchain] Build sanitizers and builtins standalone for all SDKs (#78861)
Unified builds of compiler-rt together with LLVM failed for the Android SDKs. It got too complicated to redirect the way LLVM would configure the nested build-trees. Standalone builds slightly increase build time, but they turned out much simpler and we end up with less duplication of definitions.
2025-01-28 22:08:07 +01:00
Alejandro Alonso cedea94b4c Test fixes and review feedback 2025-01-09 15:54:54 -08:00
Alejandro Alonso c62e851e38 Implement RemoteInspection support for Builtin.FixedArray 2025-01-08 10:37:17 -08:00
Hiroshi Yamauchi 32832dd1e1 Revert "[windows][toolchain] Enable builtins and sanitizers"
Revert https://github.com/swiftlang/swift/pull/77770

To fix CI https://ci-external.swift.org/job/swift-main-windows-toolchain-arm64/785/consoleText
2024-12-06 14:22:30 -08:00
Stefan Gränitz 2f7116a36f Disable tests newly included with asan_runtime available, but not supported on Windows yet 2024-12-03 18:41:49 +01: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
Venkatesh Sriram 0d9e62e143 Merge pull request #76917 from venkatesh5789/external-conformance-info
[Compile Time Constant Extraction] Add information about where a particular conformance has been defined
2024-10-17 10:19:07 -07:00
Venkatesh Sriram 9ca55fdf89 [Compile Time Constant Extraction] Add information about where a particular conformance has been defined 2024-10-15 15:46:21 -07:00
Mike Ash 53c6d5b1fe [Tests][Reflection] Fully disable typeref_decoding_asan on Linux aarch64.
We XFAILed it but it's still passing sometimes.
2024-10-11 08:57:52 -04:00
Mike Ash 36102bad19 [Tests][Reflection] Re-disable typeref_decoding_asan on Linux aarch64.
This test was failing for a long time, spontaneously started working, and now seems to have spontaneously started failing again. Turning it back off, just on Linux aarch64, until we can figure out how to fix it.

rdar://137532051
2024-10-09 16:58:56 -04:00
Ben Langmuir b5f290dc49 [test] Move to earlier deployment target as workaround
We are already using 5.4 target as a workaround for missing
LC_DYLD_CHAINED_FIXUPS support in reflection tools, but we need to
further workaround a linker bug in older versions of ld-prime that
caused appletv simulator platform to be misidentified and use chained
fixups earlier than it should, so move back to 5.2.
2024-08-30 14:03:04 -07:00
Ben Langmuir 5d111db75a Add explicit targets to Reflection tests due to chained fixups issue
When the deployment target is newer than swift-5.4 these tests fail due
to missing/incomplete support for chained fixups.

rdar://134809489
2024-08-29 07:55:14 -07:00
Alastair Houghton 1925242c2d [Tests][Reflection] typeref_decoding_asan now passes on aarch Linux.
This test now passes; presumably we fixed something that was causing
it to fail.

rdar://134053352
2024-08-16 16:03:25 +01:00
artemcm e7ba93f20f Restrict preserve_conformance_metadata_attr_macros.swift test to OS supported by binary metadata reading tooling 2024-05-24 09:15:53 -07:00
Augusto Noronha dd39730d74 Merge pull request #73723 from augusto2112/default-actor-ti-main
[RemoteInspection] Hardcode DefaultActorStorage's type info
2024-05-22 11:14:47 -07:00
Augusto Noronha 4417786be4 [RemoteInspection] Hardcode DefaultActorStorage's type info
No metadata is emitted for the builtin DefaultActorStorage type. Since
its layout is fixed, hardcode its definition in Remote Mirrors.

rdar://128032250
2024-05-17 14:29:25 -07:00
artemcm c47cd7a107 Apply the @_alwaysEmitConformanceMetadata semantics to conformances originating from macro-expanded declarations and extensions
Existing code does not visit such declarations and does not mark them to be preserved in the binary even if not public and used.

Resolves rdar://127903662
2024-05-16 15:58:11 -04:00
Ben Barham c1031b4844 [Test] Temporarily mark typeref_decoding.swift as unsupported
This seems to be failing on Linux aarch64 on and off. Mark unsupported
while we investigate.
2024-05-10 09:43:18 -07:00
Konrad `ktoso` Malawski 2f361ae9e1 XFAIL typeref_decoding.swift (#73537) 2024-05-10 09:09:04 +09:00
Artem Chikin 01d891ad99 Merge pull request #72834 from artemcm/UpstreamVisionOS
Introduce visionOS Platform
2024-04-15 09:33:49 -07:00
Artem Chikin 1f14158a1d Introduce VisionOS Platform
This change introduces a new compilation target platform to the Swift compiler - visionOS.

- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
2024-04-10 09:38:02 -07:00
Meghana Gupta 2d3d74b4eb Disable test Reflection/preserve_conformance_metadata_attr.swift 2024-04-08 11:55:18 -07:00
Slava Pestov 480592a7d5 Merge pull request #72847 from slavapestov/fix-rdar123645784
Fix two problems with opaque return types -vs- parameter packs
2024-04-05 07:31:34 -04:00
Slava Pestov 153da37521 IRGen: Use getMaximalTypeExpansionContext() 2024-04-04 19:36:25 -04:00
Artem Chikin 69fdc1356c Revert "Revert "Add mandatory SIL pass implementing '@_alwaysEmitConformanceMetadata' protocol attribute"" 2024-04-03 09:29:51 -07:00