Skip to content

Commit 72fff91

Browse files
committed
SwiftCompilerSources: bridge Type.isEmpty
1 parent 340bd26 commit 72fff91

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

SwiftCompilerSources/Sources/SIL/Type.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ public struct Type : CustomStringConvertible, NoReflectionChildren {
8686
bridged.isExactSuperclassOf(type.bridged)
8787
}
8888

89+
public func isEmpty(in function: Function) -> Bool {
90+
bridged.isEmpty(function.bridged)
91+
}
92+
8993
public var tupleElements: TupleElementArray { TupleElementArray(type: self) }
9094

9195
/// Can only be used if the type is in fact a nominal type (`isNominal` is true).

include/swift/SIL/SILBridging.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ struct BridgedType {
332332
BRIDGED_INLINE bool isMetatype() const;
333333
BRIDGED_INLINE bool isNoEscapeFunction() const;
334334
BRIDGED_INLINE bool isAsyncFunction() const;
335+
BRIDGED_INLINE bool isEmpty(BridgedFunction f) const;
335336
BRIDGED_INLINE TraitResult canBeClass() const;
336337
BRIDGED_INLINE bool isMoveOnly() const;
337338
BRIDGED_INLINE bool isEscapable() const;

include/swift/SIL/SILBridgingImpl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ bool BridgedType::isAsyncFunction() const {
230230
return unbridged().isAsyncFunction();
231231
}
232232

233+
bool BridgedType::isEmpty(BridgedFunction f) const {
234+
return unbridged().isEmpty(*f.getFunction());
235+
}
236+
233237
BridgedType::TraitResult BridgedType::canBeClass() const {
234238
return (TraitResult)unbridged().canBeClass();
235239
}

0 commit comments

Comments
 (0)