File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
SwiftCompilerSources/Sources/SIL Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,13 @@ extension Context {
48
48
49
49
public func getBuiltinIntegerType( bitWidth: Int ) -> Type { _bridged. getBuiltinIntegerType ( bitWidth) . type }
50
50
51
+ public func getTupleType( elements: [ Type ] ) -> AST . `Type` {
52
+ let bridgedElements = elements. map { $0. bridged }
53
+ return bridgedElements. withBridgedArrayRef {
54
+ AST . `Type` ( bridged: _bridged. getTupleType ( $0) )
55
+ }
56
+ }
57
+
51
58
public var swiftArrayDecl : NominalTypeDecl {
52
59
_bridged. getSwiftArrayDecl ( ) . getAs ( NominalTypeDecl . self)
53
60
}
Original file line number Diff line number Diff line change @@ -1425,6 +1425,7 @@ struct BridgedContext {
1425
1425
SWIFT_IMPORT_UNSAFE OptionalBridgedFunction lookUpNominalDeinitFunction (BridgedDeclObj nominal) const ;
1426
1426
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedSubstitutionMap getContextSubstitutionMap (BridgedType type) const ;
1427
1427
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedType getBuiltinIntegerType (SwiftInt bitWidth) const ;
1428
+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType getTupleType (BridgedArrayRef elementTypes) const ;
1428
1429
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj getSwiftArrayDecl () const ;
1429
1430
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj getSwiftMutableSpanDecl () const ;
1430
1431
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedValue getSILUndef (BridgedType type) const ;
Original file line number Diff line number Diff line change @@ -2847,6 +2847,14 @@ BridgedType BridgedContext::getBuiltinIntegerType(SwiftInt bitWidth) const {
2847
2847
return swift::SILType::getBuiltinIntegerType (bitWidth, context->getModule ()->getASTContext ());
2848
2848
}
2849
2849
2850
+ BridgedASTType BridgedContext::getTupleType (BridgedArrayRef elementTypes) const {
2851
+ llvm::SmallVector<swift::TupleTypeElt, 8 > elements;
2852
+ for (auto bridgedElmtTy : elementTypes.unbridged <BridgedASTType>()) {
2853
+ elements.push_back (bridgedElmtTy.unbridged ());
2854
+ }
2855
+ return {swift::TupleType::get (elements, context->getModule ()->getASTContext ())};
2856
+ }
2857
+
2850
2858
BridgedDeclObj BridgedContext::getSwiftArrayDecl () const {
2851
2859
return {context->getModule ()->getASTContext ().getArrayDecl ()};
2852
2860
}
You can’t perform that action at this time.
0 commit comments