Commit Graph

14 Commits

Author SHA1 Message Date
Finagolfin
30ba49e7fa [android][test] Fix a handful of tests and disable one CxxToSwiftToCxx bridging test
Also, make the analogous change to apple/swift-driver#1372, which gets the
sanitizer tests working on Android again, and remove the lld_lto feature in the
tests, which is now unused.
2023-08-12 16:36:35 +05:30
Adrian Prantl
75c42ed43b [swift-reflection-dump] Turn --binary-filename into a positional argument.
I mostly find it annoying to type and this makes the usage of the tool more
consistent with other similar tools like dwarfdump or otool.
2022-10-12 11:18:59 -07:00
Mike Ash
373000eb1d [Test] Re-disable some Reflection tests on ARM64e.
These tests are still broken on ARM64e:

Reflection/conformance_descriptors.swift
Reflection/typeref_decoding_imported.swift
Reflection/typeref_decoding_objc.swift
Reflection/typeref_lowering.swift

rdar://100558042
2022-09-29 09:07:20 -04:00
Mike Ash
cdfbd7b91d [Test] Reenable Reflection tests disabled on ARM64e.
Improvements in our ARM64e support seems to have made these test work again.

rdar://89754240
rdar://89986398
2022-09-22 11:16:21 -04:00
Artem Chikin
bc795187d7 [Static Mirror] Handle anonymous contexts when re-constructing fully-qualified type names
Anonymous contexts (e.g. types nested inside functons) require special handling when we are constructing a fully-qualified name. We construct the name by walking from a type's descriptor to its parent contexts. Previously, we would give up upon encountering an anonymous contexts.

This change refactors fully-qualified name construction to happen in two phases:
1. Collect a full context ancestor chain
2. Walk the chain backwards to reconstruct the fully-qualified name
As opposed to the previous approach which always constructed the name while recursively walking to the parent context. This is required because types nested inside anonymous contexts are represented in the fully-qualified type name as `(type_name in $XXXXXXXX)` where XXXXXXXX is the address of the context descriptor of the parent anonymous context.

Resolves rdar://91073103
2022-05-31 15:56:31 -07:00
Ben Barham
c163e0fe5e [Tests] Make OS features consistent
lit.py currently allows any substring of `target_triple` to be used as a
feature in REQUIRES/UNSUPPORTED/XFAIL. This results in various forms of
the OS spread across the tests and is also somewhat confusing since they
aren't actually listed in the available features.

Modify all OS-related features to use the `OS=` version that Swift adds
instead. We can later remove `config.target_triple` so that these don't
the non-OS versions don't work in the first place.
2022-05-20 19:51:23 -07:00
Artem Chikin
8d66336342 [Static Mirror] Gather local type extension conformance infos correctly
Conformance Infos for nominal type declarations reference the conforming type by storing an offset to the address in the binary where the type's type descriptor is located. Conformance infos for conformances applied to an extension of a type use a different mechanism: they use an indirect reference to a dynamic symbol, which may be an external symbol **or** a resolved address to a local type descriptor. It is the latter case that the conformance-gather implementation was missing that is added in this PR.

Resolves rdar://93578419
2022-05-19 08:48:50 -07:00
Artem Chikin
b1b9e07f79 [Swift Static Mirror] Report mangled names without a prefix
Leave it to the clients to add it, if necessary.

Resolves rdar://90040835
2022-03-15 13:47:39 -07:00
Hamish Knight
2cba680599 [test] Disable conformance_descriptors.swift on arm64e
rdar://88579818
2022-03-08 13:37:45 +00:00
Artem Chikin
fcba475a36 Pass in libswiftCore.dylib as input to conformance_descriptors.swift
This will make the test more robust in being able to read out the conformances we are looking for (Hashable, Equatable)

Resolves rdar://88579818
2022-02-09 09:13:08 -08:00
Artem Chikin
bc9aedadc8 Disable conformance_descriptors.swift on Linux AArch64
Test failure tracked in rdar://88451721.
2022-02-03 13:18:46 -08:00
Artem Chikin
1d960370bf [Static Mirror] Add mangled names to image-extracted protocol conformance infos.
Collect the mapping of unmangled-to-mangled names from the read out `Fields` section reflection infos and use that to identify the mangled name of a conforming type of a given protocol conformance.
2022-01-30 10:53:09 -08:00
Artem Chikin
cd6d8f975f Extract fully-qualified names for protocol conformances by traversing their parent contexts and extracting their names 2022-01-28 10:51:48 -08:00
Artem Chikin
e934fe201a Add extraction protocol conformance descriptor extraction, as read from an object file image, to TypeRefBuilder. 2022-01-26 13:54:02 -08:00