@@ -173,11 +173,43 @@ static CanType getKnownType(Optional<CanType> &cacheSlot, ASTContext &C,
173
173
return t;
174
174
}
175
175
176
+ static CanType getKnownTypeFromModules4 (Optional<CanType> &cacheSlot, ASTContext &C,
177
+ StringRef moduleName1, StringRef moduleName2,
178
+ StringRef moduleName3, StringRef moduleName4,
179
+ StringRef typeName) {
180
+
181
+ auto temporaryCacheSlot = Optional<CanType>();
182
+ auto T = getKnownType (temporaryCacheSlot, C, moduleName1, typeName);
183
+
184
+ if (!T) {
185
+ temporaryCacheSlot = Optional<CanType>();
186
+ T = getKnownType (temporaryCacheSlot, C, moduleName2, typeName);
187
+ }
188
+ if (!T) {
189
+ temporaryCacheSlot = Optional<CanType>();
190
+ T = getKnownType (temporaryCacheSlot, C, moduleName3, typeName);
191
+ }
192
+ if (!T) {
193
+ temporaryCacheSlot = Optional<CanType>();
194
+ T = getKnownType (temporaryCacheSlot, C, moduleName4, typeName);
195
+ }
196
+
197
+ cacheSlot = temporaryCacheSlot;
198
+ return T;
199
+ }
200
+
176
201
#define BRIDGING_KNOWN_TYPE (BridgedModule,BridgedType ) \
177
202
CanType TypeConverter::get##BridgedType##Type() { \
178
203
return getKnownType (BridgedType##Ty, M.getASTContext (), \
179
204
#BridgedModule, #BridgedType); \
180
205
}
206
+ #define BRIDGING_KNOWN_TYPE_WITH_MODULES_4 (BridgedModule1,BridgedModule2,BridgedModule3,BridgedModule4,BridgedType ) \
207
+ CanType TypeConverter::get##BridgedType##Type() { \
208
+ return getKnownTypeFromModules4 (BridgedType##Ty, M.getASTContext (), \
209
+ #BridgedModule1, #BridgedModule2, \
210
+ #BridgedModule3, #BridgedModule4, \
211
+ #BridgedType); \
212
+ }
181
213
#include " swift/SIL/BridgedTypes.def"
182
214
183
215
// / Adjust a function type to have a slightly different type.
0 commit comments