mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Implement the ReflectionContext's implementation of: swift_reflection_projectExistential. First, we get the type info of the existential typeref - it should be a record type info. If it's a class existential, it has trivial layout: the first word is a pointer to the class instance. Otherwise, if the value fits in the 3-word buffer of the existential container, it trivially is also at the start of the container. Otherwise, the value is off in a heap box somewhere, but the first word of the container is a pointer to that box.