@@ -273,6 +273,9 @@ class SwiftLanguageRuntime : public LanguageRuntime {
273
273
Address &address, Value::ValueType &value_type,
274
274
llvm::ArrayRef<uint8_t > &local_buffer) override ;
275
275
276
+ llvm::Expected<CompilerType> BindGenericPackType (StackFrame &frame,
277
+ CompilerType pack_type,
278
+ bool *indirect = nullptr );
276
279
CompilerType BindGenericTypeParameters (
277
280
CompilerType unbound_type,
278
281
std::function<CompilerType(unsigned , unsigned )> finder);
@@ -343,12 +346,20 @@ class SwiftLanguageRuntime : public LanguageRuntime {
343
346
unsigned dependent_generic_param_count = 0 ;
344
347
unsigned num_counts = 0 ;
345
348
346
- unsigned GetNumValuePacks () { return count_for_value_pack.size (); }
347
- unsigned GetNumTypePacks () { return count_for_type_pack.size (); }
348
- unsigned GetCountForValuePack (unsigned i) {
349
+ unsigned GetNumValuePacks () const { return count_for_value_pack.size (); }
350
+ unsigned GetNumTypePacks () const { return count_for_type_pack.size (); }
351
+ unsigned GetCountForValuePack (unsigned i) const {
349
352
return count_for_value_pack[i];
350
353
}
351
- unsigned GetCountForTypePack (unsigned i) { return count_for_type_pack[i]; }
354
+ unsigned GetCountForTypePack (unsigned i) const { return count_for_type_pack[i]; }
355
+ bool HasPacks () const { return pack_expansions.size (); }
356
+ bool IsPack (unsigned depth, unsigned index) const {
357
+ if (HasPacks ())
358
+ for (auto param : generic_params)
359
+ if (param.depth == depth && param.index == index)
360
+ return param.is_pack ;
361
+ return false ;
362
+ }
352
363
};
353
364
// / Extract the generic signature out of a mangled Swift function name.
354
365
static std::optional<GenericSignature>
@@ -359,8 +370,8 @@ class SwiftLanguageRuntime : public LanguageRuntime {
359
370
// / version of \p base_type that replaces all generic type
360
371
// / parameters with bound generic types. If a generic type parameter
361
372
// / cannot be resolved, the input type is returned.
362
- CompilerType BindGenericTypeParameters (StackFrame &stack_frame,
363
- CompilerType base_type);
373
+ llvm::Expected< CompilerType>
374
+ BindGenericTypeParameters (StackFrame &stack_frame, CompilerType base_type);
364
375
365
376
bool IsStoredInlineInBuffer (CompilerType type) override ;
366
377
@@ -580,13 +591,14 @@ class SwiftLanguageRuntime : public LanguageRuntime {
580
591
GetRemoteASTContext (SwiftASTContext &swift_ast_ctx);
581
592
582
593
// / Like \p BindGenericTypeParameters but for TypeSystemSwiftTypeRef.
583
- CompilerType BindGenericTypeParameters (StackFrame &stack_frame,
584
- TypeSystemSwiftTypeRef &ts,
585
- ConstString mangled_name);
594
+ llvm::Expected< CompilerType>
595
+ BindGenericTypeParameters (StackFrame &stack_frame, TypeSystemSwiftTypeRef &ts,
596
+ ConstString mangled_name);
586
597
587
598
// / Like \p BindGenericTypeParameters but for RemoteAST.
588
- CompilerType BindGenericTypeParametersRemoteAST (StackFrame &stack_frame,
589
- CompilerType base_type);
599
+ llvm::Expected<CompilerType>
600
+ BindGenericTypeParametersRemoteAST (StackFrame &stack_frame,
601
+ CompilerType base_type);
590
602
591
603
bool GetDynamicTypeAndAddress_Pack (ValueObject &in_value,
592
604
CompilerType pack_type,
0 commit comments