@@ -182,9 +182,10 @@ getRuntimeVersionThatSupportsDemanglingType(CanType type) {
182
182
Swift_5_2,
183
183
Swift_5_5,
184
184
Swift_6_0,
185
+ Swift_6_1,
185
186
186
187
// Short-circuit if we find this requirement.
187
- Latest = Swift_6_0
188
+ Latest = Swift_6_1
188
189
};
189
190
190
191
VersionRequirement latestRequirement = None;
@@ -198,16 +199,29 @@ getRuntimeVersionThatSupportsDemanglingType(CanType type) {
198
199
199
200
(void ) type.findIf ([&](CanType t) -> bool {
200
201
if (auto fn = dyn_cast<AnyFunctionType>(t)) {
202
+ auto isolation = fn->getIsolation ();
203
+ auto sendingResult = fn->hasSendingResult ();
204
+
205
+ // The Swift 6.1 runtime fixes a bug preventing successful demangling
206
+ // when @isolated(any) or global actor isolation is combined with a
207
+ // sending result.
208
+ if (sendingResult &&
209
+ (isolation.isErased () || isolation.isGlobalActor ()))
210
+ return addRequirement (Swift_6_1);
211
+
201
212
// The Swift 6.0 runtime is the first version able to demangle types
202
- // that involve typed throws or @isolated(any), or for that matter
203
- // represent them at all at runtime.
204
- if (!fn.getThrownError ().isNull () || fn->getIsolation ().isErased ())
213
+ // that involve typed throws, @isolated(any), or a sending result, or
214
+ // for that matter to represent them at all at runtime.
215
+ if (!fn.getThrownError ().isNull () ||
216
+ isolation.isErased () ||
217
+ sendingResult)
205
218
return addRequirement (Swift_6_0);
206
219
207
220
// The Swift 5.5 runtime is the first version able to demangle types
208
221
// related to concurrency.
209
- if (fn->isAsync () || fn->isSendable () ||
210
- !fn->getIsolation ().isNonIsolated ())
222
+ if (fn->isAsync () ||
223
+ fn->isSendable () ||
224
+ !isolation.isNonIsolated ())
211
225
return addRequirement (Swift_5_5);
212
226
213
227
return false ;
@@ -255,6 +269,7 @@ getRuntimeVersionThatSupportsDemanglingType(CanType type) {
255
269
});
256
270
257
271
switch (latestRequirement) {
272
+ case Swift_6_1: return llvm::VersionTuple (6 , 1 );
258
273
case Swift_6_0: return llvm::VersionTuple (6 , 0 );
259
274
case Swift_5_5: return llvm::VersionTuple (5 , 5 );
260
275
case Swift_5_2: return llvm::VersionTuple (5 , 2 );
0 commit comments