Skip to content

Commit 1486d00

Browse files
eecksteinaschwaighofer
authored andcommitted
AST: add var ProtocolDecl.isMarkerProtocol
1 parent b218d9a commit 1486d00

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

SwiftCompilerSources/Sources/AST/Declarations.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ final public class ClassDecl: NominalTypeDecl {
7676

7777
final public class ProtocolDecl: NominalTypeDecl {
7878
public var requiresClass: Bool { bridged.ProtocolDecl_requiresClass() }
79+
public var isMarkerProtocol: Bool { bridged.ProtocolDecl_isMarkerProtocol() }
7980
}
8081

8182
final public class BuiltinTupleDecl: NominalTypeDecl {}

include/swift/AST/ASTBridging.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ struct BridgedDeclObj {
335335
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType Class_getSuperclass() const;
336336
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj Class_getDestructor() const;
337337
BRIDGED_INLINE bool ProtocolDecl_requiresClass() const;
338+
BRIDGED_INLINE bool ProtocolDecl_isMarkerProtocol() const;
338339
BRIDGED_INLINE bool AbstractFunction_isOverridden() const;
339340
BRIDGED_INLINE bool Destructor_isIsolated() const;
340341
BRIDGED_INLINE bool EnumElementDecl_hasAssociatedValues() const;

include/swift/AST/ASTBridgingImpl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ bool BridgedDeclObj::ProtocolDecl_requiresClass() const {
222222
return getAs<swift::ProtocolDecl>()->requiresClass();
223223
}
224224

225+
bool BridgedDeclObj::ProtocolDecl_isMarkerProtocol() const {
226+
return getAs<swift::ProtocolDecl>()->isMarkerProtocol();
227+
}
228+
225229
bool BridgedDeclObj::AbstractFunction_isOverridden() const {
226230
return getAs<swift::AbstractFunctionDecl>()->isOverridden();
227231
}

0 commit comments

Comments
 (0)