Merge pull request #85644 from aschwaighofer/wip_embedded_exits_with_eriks_changes_v1

[embedded] Fix associated type conformances for specialized witness tables
This commit is contained in:
Arnold Schwaighofer
2025-12-01 16:40:31 -08:00
committed by GitHub
20 changed files with 517 additions and 9 deletions

View File

@@ -348,6 +348,7 @@ struct BridgedDeclObj {
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj Class_getDestructor() const;
BRIDGED_INLINE bool Class_isForeign() const;
BRIDGED_INLINE bool ProtocolDecl_requiresClass() const;
BRIDGED_INLINE bool ProtocolDecl_isMarkerProtocol() const;
BRIDGED_INLINE bool AbstractFunction_isOverridden() const;
BRIDGED_INLINE bool Destructor_isIsolated() const;
BRIDGED_INLINE bool EnumElementDecl_hasAssociatedValues() const;

View File

@@ -264,6 +264,10 @@ bool BridgedDeclObj::ProtocolDecl_requiresClass() const {
return getAs<swift::ProtocolDecl>()->requiresClass();
}
bool BridgedDeclObj::ProtocolDecl_isMarkerProtocol() const {
return getAs<swift::ProtocolDecl>()->isMarkerProtocol();
}
bool BridgedDeclObj::AbstractFunction_isOverridden() const {
return getAs<swift::AbstractFunctionDecl>()->isOverridden();
}

View File

@@ -809,6 +809,7 @@ struct BridgedInstruction {
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedConformanceArray InitExistentialRefInst_getConformances() const;
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedCanType InitExistentialRefInst_getFormalConcreteType() const;
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedConformanceArray InitExistentialAddrInst_getConformances() const;
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedCanType InitExistentialAddrInst_getFormalConcreteType() const;
BRIDGED_INLINE bool OpenExistentialAddr_isImmutable() const;
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedGlobalVar GlobalAccessInst_getGlobal() const;
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedGlobalVar AllocGlobalInst_getGlobal() const;

View File

@@ -1292,6 +1292,11 @@ BridgedCanType BridgedInstruction::InitExistentialRefInst_getFormalConcreteType(
BridgedConformanceArray BridgedInstruction::InitExistentialAddrInst_getConformances() const {
return {getAs<swift::InitExistentialAddrInst>()->getConformances()};
}
BridgedCanType BridgedInstruction::InitExistentialAddrInst_getFormalConcreteType() const {
return getAs<swift::InitExistentialAddrInst>()->getFormalConcreteType();
}
bool BridgedInstruction::OpenExistentialAddr_isImmutable() const {
switch (getAs<swift::OpenExistentialAddrInst>()->getAccessKind()) {
case swift::OpenedExistentialAccess::Immutable: return true;

View File

@@ -216,7 +216,9 @@ public:
ReabstractionInfo(CanSILFunctionType substitutedType,
SILDeclRef methodDecl,
bool convertIndirectToDirect,
SILModule &M) :
ConvertIndirectToDirect(convertIndirectToDirect),
SubstitutedType(substitutedType),
methodDecl(methodDecl),
M(&M), isWholeModule(M.isWholeModule()) {}