If the field address comes from a struct_element_addr which is a result of an optimized `MemoryLayout<S>.offset(of: \.field)` we cannot return undef.
We have to be consistent with `offset(of:)`, which returns 0.
Therefore we need to return the base address of the struct.
rdar://117265274
We don't currently support building resilient relative protocol witness tables.
One might want to build with relative witness tables but not need
resilient protocols. Allow for that scenario.
Add a test configuration to test library-evolution + fragile resilient
protocols + relative protocol witness tables.
Previously, when the metadata collector only collected for layout, it
was wasteful to visit the empty fields of records. Now that the field
may require a deinit call, it's necessary to visit it.
rdar://123577998
Renamed "getUsesMoveableValueDebugInfo" to "usesMoveableValueDebugInfo".
Clarifies the predicate from "does the receiver have the
usesMoveableValueDebugInfo field set?" to "does the receiver use moveable
value debug info?".
In the end this condition exists to avoid a BitCode Verifyer check that operates
off the scope, so looking for that directly is more future-proof.
rdar://123334375
When emitting reflection metadata for fields that have noncopyable
type with deployment targets that predate support for noncopyable
types, we introduce some indirection to make sure that these fields
are only visible to reflection clients (e.g., mirrors) when running on
a sufficiently-new Swift runtime. However, this indirection has the
downside that out-of-process clients (such as LLDB) can no longer
reflect the fields.
Tweak the heuristic to only introduce the indirection if the field is
*guaranteed* to have noncopyable type. If it somehow could be
copyable, e.g., based on the properties of its generic arguments, then
still emit the normal metadata. This eliminates regressions when
existing generic types like Optional become conditionally Copyable
(based on their Wrapped functions).
Don't mangle inverse conformances for symbols related to dispatch thunks,
protocol members, and other entities that are inexorably tied to the
primary definition of the type and must have stable names.
Extend the conditional suppression of inverse conformance mangling to
property descriptors and more conformance-related symbols.
We've been building up this exponential explosion of task-creation
builtins because it's not currently possible to overload builtins.
As long as all of the operands are scalar, though, it's pretty easy
to peephole optional injections in IRGen, which means we can at
least just use a single builtin in SIL and then break it apart in
IRGen to decide which options to set.
I also eliminated the metadata argument, which can easily be recreated
from the substitutions. I also added proper verification for the builtin,
which required (1) getting `@Sendable` right more consistently and (2)
updating a bunch of tests checking for things that are not actually
valid, like passing a function that returns an Int directly.
Distributed protocol requirements don't have associated SILFunction,
let's introduce a more flexible way to define it that collects only
the information necessary for the function to become accessible.
Given the following protocol:
```
protocol Greeter : DistributedActor {
distributed func greet()
}
```
The changes make it possible to synthesize a distributed accessor
thunk for the requirement `greet` which would be dispatched to the
underlying concrete actor implementation at runtime.