**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.
To determine the correct enum layout, we first count various
categories of cases. Before, we counted indirect generic cases as
"generic", but regular "generic" cases can't export spare bits.
Change this to count "indirect" cases as a separate category.
In particular, this ensures that fully-indirect enums use
spare bits from the pointers even when some or all of the cases
are generic.
Resolves rdar://133890406
The first word in a class existential is the class pointer itself.
This pointer exposes spare bits differently depending
on the platform, which becomes apparent when you try to reflect
an Optional carrying such an MPE.
Add new test cases and some logic to zero out the first
word of spare bit information only on platforms with 8-byte pointers.
Class existentials expose spare bits from all of the pointers, not just the first one.
Due to a bad bug here, we were properly exposing spare bits from the first pointer,
but then claiming that all bits of subsequent pointers were spare.
This accidentally resulted in the correct operation on 64-bit targets
(it picked the highest-order spare bit, which happened to be spare
in both the broken mask and the correct mask). But on 32-bit targets,
this exposed the high-order bits of pointers, which is incorrect.
Expand the test a bit while we're here as well.
Resolves rdar://132715829
This plugs a hole where we failed to recognize a CF type when it
appeared as the payload of an enum stored as a property. Curiously,
RemoteMirror is able to reflect this when the enum appears by itself,
just not when it's stored as a property.
The simplest fix is to hook into the TypeInfo calculation which
computes a TypeInfo (basically, the tree of fields) from a TypeRef
(basically, the name of the type, including generic context).
Specifically, we sometimes end up here with a "type alias" that
none of the lookup support seems to be able to handle. Fortunately,
these aliases demangle into a pretty predictable shape, so this
just pattern-matches the specific demangle tree shape to recognize
these as "type aliases in the `__C` module whose name starts with `CF`
and ends with `Ref`".
Resolves rdar://82465109
Add specific deployment target versions to some tests that need to test
10.x-specific behaviours and are currently depending on the default
deployment target.
Certain tests were only checking either the stable or unstable ABI
depending on the platform the test was running. In those cases I doubled
up the checks so that we would test both cases on platforms that
supported it. This might use a bit of extra time on targets that only
support the stable ABI, but it seemed worth it for the additional
coverage in CI.
The legacy `module.map` spelling of module map files was deprecated by llvm/llvm-project#75142 and clang expects to remove support for them in the future. Switch all tests to use the supported spelling.
Fixes rdar://128431478.
UnsafeContinuations can be stored in variables or properties,
so it's important for RemoteMirror to be able to at least minimally
recognize them.
This just treats an UnsafeContinuation as a refcounted pointer.
Which might be "good enough" for now.
Working towards rdar://110351406
The "generic depth" is used to match up generic type variables.
For example:
```
struct Foo<T> { // `T` at generic depth 0
struct Bar {
struct Baz<U> { // 'U' at generic depth 1
...
}}}
```
Note in the above that `Bar` is not counted in the
generic depth. The previous logic did count `Bar` in
the generic depth calculation, leading to mismatches
when trying to associate references to generic variables.
This adds a new test with cases like the above and of course
corrects the calculation.
Resolves rdar://127450037