Skip to content

Commit a371aec

Browse files
committed
AST: add var ClassDecl.isForeign
1 parent fa55b25 commit a371aec

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
@@ -128,6 +128,8 @@ final public class ClassDecl: NominalTypeDecl {
128128
final public var destructor: DestructorDecl {
129129
bridged.Class_getDestructor().getAs(DestructorDecl.self)
130130
}
131+
132+
public var isForeign: Bool { bridged.Class_isForeign() }
131133
}
132134

133135
final public class ProtocolDecl: NominalTypeDecl {

include/swift/AST/ASTBridging.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ struct BridgedDeclObj {
346346
BRIDGED_INLINE bool Struct_hasUnreferenceableStorage() const;
347347
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType Class_getSuperclass() const;
348348
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj Class_getDestructor() const;
349+
BRIDGED_INLINE bool Class_isForeign() const;
349350
BRIDGED_INLINE bool ProtocolDecl_requiresClass() const;
350351
BRIDGED_INLINE bool AbstractFunction_isOverridden() const;
351352
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
@@ -256,6 +256,10 @@ BridgedDeclObj BridgedDeclObj::Class_getDestructor() const {
256256
return {getAs<swift::ClassDecl>()->getDestructor()};
257257
}
258258

259+
bool BridgedDeclObj::Class_isForeign() const {
260+
return getAs<swift::ClassDecl>()->isForeign();
261+
}
262+
259263
bool BridgedDeclObj::ProtocolDecl_requiresClass() const {
260264
return getAs<swift::ProtocolDecl>()->requiresClass();
261265
}

0 commit comments

Comments
 (0)