@@ -273,6 +273,9 @@ class SwiftLanguageRuntime : public LanguageRuntime {
273273 Address &address, Value::ValueType &value_type,
274274 llvm::ArrayRef<uint8_t > &local_buffer) override ;
275275
276+ llvm::Expected<CompilerType> BindGenericPackType (StackFrame &frame,
277+ CompilerType pack_type,
278+ bool *indirect = nullptr );
276279 CompilerType BindGenericTypeParameters (
277280 CompilerType unbound_type,
278281 std::function<CompilerType(unsigned , unsigned )> finder);
@@ -343,12 +346,20 @@ class SwiftLanguageRuntime : public LanguageRuntime {
343346 unsigned dependent_generic_param_count = 0 ;
344347 unsigned num_counts = 0 ;
345348
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 {
349352 return count_for_value_pack[i];
350353 }
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+ }
352363 };
353364 // / Extract the generic signature out of a mangled Swift function name.
354365 static std::optional<GenericSignature>
@@ -359,8 +370,8 @@ class SwiftLanguageRuntime : public LanguageRuntime {
359370 // / version of \p base_type that replaces all generic type
360371 // / parameters with bound generic types. If a generic type parameter
361372 // / 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);
364375
365376 bool IsStoredInlineInBuffer (CompilerType type) override ;
366377
@@ -580,13 +591,14 @@ class SwiftLanguageRuntime : public LanguageRuntime {
580591 GetRemoteASTContext (SwiftASTContext &swift_ast_ctx);
581592
582593 // / 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);
586597
587598 // / 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);
590602
591603 bool GetDynamicTypeAndAddress_Pack (ValueObject &in_value,
592604 CompilerType pack_type,
0 commit comments