Skip to content

Commit ba1b8f8

Browse files
committed
AST: add var ClassDecl.isForeign
1 parent 508bd4f commit ba1b8f8

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

SwiftCompilerSources/Sources/AST/Declarations.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ final public class ClassDecl: NominalTypeDecl {
7272
final public var destructor: DestructorDecl {
7373
bridged.Class_getDestructor().getAs(DestructorDecl.self)
7474
}
75+
76+
public var isForeign: Bool { bridged.Class_isForeign() }
7577
}
7678

7779
final public class ProtocolDecl: NominalTypeDecl {

include/swift/AST/ASTBridging.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ struct BridgedDeclObj {
334334
BRIDGED_INLINE bool Struct_hasUnreferenceableStorage() const;
335335
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType Class_getSuperclass() const;
336336
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj Class_getDestructor() const;
337+
BRIDGED_INLINE bool Class_isForeign() const;
337338
BRIDGED_INLINE bool ProtocolDecl_requiresClass() const;
338339
BRIDGED_INLINE bool AbstractFunction_isOverridden() const;
339340
BRIDGED_INLINE bool Destructor_isIsolated() const;

include/swift/AST/ASTBridgingImpl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ BridgedDeclObj BridgedDeclObj::Class_getDestructor() const {
218218
return {getAs<swift::ClassDecl>()->getDestructor()};
219219
}
220220

221+
bool BridgedDeclObj::Class_isForeign() const {
222+
return getAs<swift::ClassDecl>()->isForeign();
223+
}
224+
221225
bool BridgedDeclObj::ProtocolDecl_requiresClass() const {
222226
return getAs<swift::ProtocolDecl>()->requiresClass();
223227
}

0 commit comments

Comments
 (0)