Skip to content

Commit 77dab77

Browse files
committed
Swift SIL: make isLegalFormalType available in AST.Type
1 parent 431401c commit 77dab77

File tree

6 files changed

+7
-6
lines changed

6 files changed

+7
-6
lines changed

SwiftCompilerSources/Sources/AST/Type.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public protocol TypeProperties {
8484
extension TypeProperties {
8585
public var description: String { String(taking: type.bridged.getDebugDescription()) }
8686

87+
public var isLegalFormalType: Bool { type.bridged.isLegalFormalType() }
8788
public var hasTypeParameter: Bool { type.bridged.hasTypeParameter() }
8889
public var hasLocalArchetype: Bool { type.bridged.hasLocalArchetype() }
8990
public var isExistentialArchetype: Bool { type.bridged.isExistentialArchetype() }

SwiftCompilerSources/Sources/SIL/Type.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public struct Type : CustomStringConvertible, NoReflectionChildren {
104104
public var isBuiltinVector: Bool { bridged.isBuiltinVector() }
105105
public var builtinVectorElementType: Type { bridged.getBuiltinVectorElementType().type }
106106

107-
public var isLegalFormalType: Bool { bridged.isLegalFormalType() }
107+
public var isLegalFormalType: Bool { astType.isLegalFormalType }
108108

109109
public func isBuiltinInteger(withFixedWidth width: Int) -> Bool {
110110
bridged.isBuiltinFixedWidthInteger(width)

include/swift/AST/ASTBridging.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3004,6 +3004,7 @@ struct BridgedASTType {
30043004
BRIDGED_INLINE swift::Type unbridged() const;
30053005
BRIDGED_INLINE BridgedOwnedString getDebugDescription() const;
30063006
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedCanType getCanonicalType() const;
3007+
BRIDGED_INLINE bool isLegalFormalType() const;
30073008
BRIDGED_INLINE bool hasTypeParameter() const;
30083009
BRIDGED_INLINE bool hasLocalArchetype() const;
30093010
BRIDGED_INLINE bool isExistentialArchetype() const;

include/swift/AST/ASTBridgingImpl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,10 @@ BridgedCanType BridgedASTType::getCanonicalType() const {
398398
return unbridged()->getCanonicalType();
399399
}
400400

401+
bool BridgedASTType::isLegalFormalType() const {
402+
return unbridged()->isLegalFormalType();
403+
}
404+
401405
bool BridgedASTType::hasTypeParameter() const {
402406
return unbridged()->hasTypeParameter();
403407
}

include/swift/SIL/SILBridging.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ struct BridgedType {
275275
BRIDGED_INLINE bool isBuiltinInteger() const;
276276
BRIDGED_INLINE bool isBuiltinFloat() const;
277277
BRIDGED_INLINE bool isBuiltinVector() const;
278-
BRIDGED_INLINE bool isLegalFormalType() const;
279278
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedType getBuiltinVectorElementType() const;
280279
BRIDGED_INLINE bool isBuiltinFixedWidthInteger(SwiftInt width) const;
281280
BRIDGED_INLINE bool isExactSuperclassOf(BridgedType t) const;

include/swift/SIL/SILBridgingImpl.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,6 @@ bool BridgedType::isBuiltinVector() const {
450450
return unbridged().isBuiltinVector();
451451
}
452452

453-
bool BridgedType::isLegalFormalType() const {
454-
return unbridged().getASTType()->isLegalFormalType();
455-
}
456-
457453
BridgedType BridgedType::getBuiltinVectorElementType() const {
458454
return unbridged().getBuiltinVectorElementType();
459455
}

0 commit comments

Comments
 (0)