@@ -402,6 +402,7 @@ struct Function {
402402 StringRef SwiftName;
403403 StringRef Type;
404404 StringRef ResultType;
405+ Optional<StringRef> ImportAs;
405406};
406407
407408typedef std::vector<Function> FunctionsSeq;
@@ -424,6 +425,7 @@ template <> struct MappingTraits<Function> {
424425 IO.mapOptional (" SwiftPrivate" , F.SwiftPrivate );
425426 IO.mapOptional (" SwiftName" , F.SwiftName , StringRef (" " ));
426427 IO.mapOptional (" ResultType" , F.ResultType , StringRef (" " ));
428+ IO.mapOptional (" ImportAs" , F.ImportAs );
427429 }
428430};
429431} // namespace yaml
@@ -530,6 +532,9 @@ struct Tag {
530532 Optional<EnumExtensibilityKind> EnumExtensibility;
531533 Optional<bool > FlagEnum;
532534 Optional<EnumConvenienceAliasKind> EnumConvenienceKind;
535+ Optional<StringRef> ImportAs;
536+ Optional<StringRef> RetainOp;
537+ Optional<StringRef> ReleaseOp;
533538 FunctionsSeq MemberFuncs;
534539};
535540
@@ -561,6 +566,9 @@ template <> struct MappingTraits<Tag> {
561566 IO.mapOptional (" EnumExtensibility" , T.EnumExtensibility );
562567 IO.mapOptional (" FlagEnum" , T.FlagEnum );
563568 IO.mapOptional (" EnumKind" , T.EnumConvenienceKind );
569+ IO.mapOptional (" ImportAs" , T.ImportAs );
570+ IO.mapOptional (" Retain" , T.RetainOp );
571+ IO.mapOptional (" Release" , T.ReleaseOp );
564572 IO.mapOptional (" Methods" , T.MemberFuncs );
565573 }
566574};
@@ -1032,6 +1040,9 @@ namespace {
10321040 info, function.Name );
10331041 info.ResultType = std::string (function.ResultType );
10341042 info.setRetainCountConvention (function.RetainCountConvention );
1043+ if (function.ImportAs )
1044+ info.ImportAs = function.ImportAs ->str ();
1045+
10351046 Writer->addGlobalFunction (function.Name , info, swiftVersion);
10361047 }
10371048
@@ -1100,6 +1111,13 @@ namespace {
11001111 tagInfo.setFlagEnum (t.FlagEnum );
11011112 }
11021113
1114+ if (t.ImportAs )
1115+ tagInfo.setImportAs (t.ImportAs ->str ());
1116+ if (t.RetainOp )
1117+ tagInfo.setRetainOp (t.RetainOp ->str ());
1118+ if (t.ReleaseOp )
1119+ tagInfo.setReleaseOp (t.ReleaseOp ->str ());
1120+
11031121 Writer->addTag (t.Name , tagInfo, swiftVersion);
11041122
11051123 for (auto Member : t.MemberFuncs ) {
@@ -1115,6 +1133,8 @@ namespace {
11151133 info, MemberName);
11161134 info.ResultType = std::string (Member.ResultType );
11171135 info.setRetainCountConvention (Member.RetainCountConvention );
1136+ if (Member.ImportAs )
1137+ info.ImportAs = Member.ImportAs ->str ();
11181138
11191139 Writer->addMemberFunction (MemberName, info, swiftVersion);
11201140 }
0 commit comments