mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #79700 from adrian-prantl/getinstancetypeinfo
[reflection] Generalize the implementation of getInstanceTypeInfo()
This commit is contained in:
@@ -1038,10 +1038,12 @@ public:
|
||||
// Generic SIL @box type - there is always an instantiated metadata
|
||||
// pointer for the boxed type.
|
||||
if (auto Meta = readMetadata(*MetadataAddress)) {
|
||||
auto GenericHeapMeta =
|
||||
cast<TargetGenericBoxHeapMetadata<Runtime>>(Meta.getLocalBuffer());
|
||||
return getMetadataTypeInfo(GenericHeapMeta->BoxedType,
|
||||
ExternalTypeInfo);
|
||||
if (auto *GenericHeapMeta = cast<TargetGenericBoxHeapMetadata<Runtime>>(
|
||||
Meta.getLocalBuffer())) {
|
||||
auto MetadataAddress = GenericHeapMeta->BoxedType;
|
||||
auto TR = readTypeFromMetadata(MetadataAddress);
|
||||
return getTypeInfo(TR, ExternalTypeInfo);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user