@@ -141,6 +141,9 @@ class CommonTypeInfo : public CommonEntityInfo {
141
141
// / The NS error domain for this type.
142
142
std::optional<std::string> NSErrorDomain;
143
143
144
+ // / The Swift protocol that this type should be automatically conformed to.
145
+ std::optional<std::string> SwiftConformance;
146
+
144
147
public:
145
148
CommonTypeInfo () {}
146
149
@@ -165,6 +168,14 @@ class CommonTypeInfo : public CommonEntityInfo {
165
168
: std::nullopt ;
166
169
}
167
170
171
+ std::optional<std::string> getSwiftConformance () const {
172
+ return SwiftConformance;
173
+ }
174
+
175
+ void setSwiftConformance (std::optional<std::string> conformance) {
176
+ SwiftConformance = conformance;
177
+ }
178
+
168
179
friend bool operator ==(const CommonTypeInfo &, const CommonTypeInfo &);
169
180
170
181
CommonTypeInfo &operator |=(const CommonTypeInfo &RHS) {
@@ -175,6 +186,8 @@ class CommonTypeInfo : public CommonEntityInfo {
175
186
setSwiftBridge (RHS.getSwiftBridge ());
176
187
if (!NSErrorDomain)
177
188
setNSErrorDomain (RHS.getNSErrorDomain ());
189
+ if (SwiftConformance)
190
+ setSwiftConformance (RHS.getSwiftConformance ());
178
191
179
192
return *this ;
180
193
}
@@ -185,7 +198,8 @@ class CommonTypeInfo : public CommonEntityInfo {
185
198
inline bool operator ==(const CommonTypeInfo &LHS, const CommonTypeInfo &RHS) {
186
199
return static_cast <const CommonEntityInfo &>(LHS) == RHS &&
187
200
LHS.SwiftBridge == RHS.SwiftBridge &&
188
- LHS.NSErrorDomain == RHS.NSErrorDomain ;
201
+ LHS.NSErrorDomain == RHS.NSErrorDomain &&
202
+ LHS.SwiftConformance == RHS.SwiftConformance ;
189
203
}
190
204
191
205
inline bool operator !=(const CommonTypeInfo &LHS, const CommonTypeInfo &RHS) {
@@ -739,9 +753,6 @@ class TagInfo : public CommonTypeInfo {
739
753
std::optional<std::string> SwiftReleaseOp;
740
754
std::optional<std::string> SwiftDefaultOwnership;
741
755
742
- // / The Swift protocol that this type should be automatically conformed to.
743
- std::optional<std::string> SwiftConformance;
744
-
745
756
std::optional<EnumExtensibilityKind> EnumExtensibility;
746
757
747
758
TagInfo ()
@@ -790,9 +801,6 @@ class TagInfo : public CommonTypeInfo {
790
801
if (!SwiftDefaultOwnership)
791
802
SwiftDefaultOwnership = RHS.SwiftDefaultOwnership ;
792
803
793
- if (!SwiftConformance)
794
- SwiftConformance = RHS.SwiftConformance ;
795
-
796
804
if (!HasFlagEnum)
797
805
setFlagEnum (RHS.isFlagEnum ());
798
806
@@ -819,7 +827,6 @@ inline bool operator==(const TagInfo &LHS, const TagInfo &RHS) {
819
827
LHS.SwiftRetainOp == RHS.SwiftRetainOp &&
820
828
LHS.SwiftReleaseOp == RHS.SwiftReleaseOp &&
821
829
LHS.SwiftDefaultOwnership == RHS.SwiftDefaultOwnership &&
822
- LHS.SwiftConformance == RHS.SwiftConformance &&
823
830
LHS.isFlagEnum () == RHS.isFlagEnum () &&
824
831
LHS.isSwiftCopyable () == RHS.isSwiftCopyable () &&
825
832
LHS.isSwiftEscapable () == RHS.isSwiftEscapable () &&
0 commit comments