@@ -525,20 +525,18 @@ class CaptureDescriptorBuilder : public ReflectionMetadataBuilder {
525
525
CanSILFunctionType SubstCalleeType;
526
526
ArrayRef<Substitution> Subs;
527
527
HeapLayout &Layout;
528
- unsigned FirstCaptureIndex;
529
528
public:
530
529
CaptureDescriptorBuilder (IRGenModule &IGM,
531
530
llvm::SetVector<CanType> &BuiltinTypes,
532
531
SILFunction &Caller,
533
532
CanSILFunctionType OrigCalleeType,
534
533
CanSILFunctionType SubstCalleeType,
535
534
ArrayRef<Substitution> Subs,
536
- HeapLayout &Layout,
537
- unsigned FirstCaptureIndex)
535
+ HeapLayout &Layout)
538
536
: ReflectionMetadataBuilder(IGM, BuiltinTypes),
539
537
Caller (Caller), OrigCalleeType(OrigCalleeType),
540
538
SubstCalleeType(SubstCalleeType), Subs(Subs),
541
- Layout(Layout), FirstCaptureIndex(FirstCaptureIndex) {}
539
+ Layout(Layout) {}
542
540
543
541
using MetadataSourceMap
544
542
= std::vector<std::pair<CanType, const reflection::MetadataSource*>>;
@@ -617,15 +615,6 @@ class CaptureDescriptorBuilder : public ReflectionMetadataBuilder {
617
615
// dereferencing an isa pointer or a generic argument). Record
618
616
// the path. We assume captured values map 1-1 with function
619
617
// parameters.
620
- auto ParamIndex = ConventionSource.getParamIndex ();
621
- auto Index = ParamIndex - FirstCaptureIndex;
622
-
623
- auto ParamType = SubstCalleeType->getParameters ()[ParamIndex].getSILType ();
624
- auto CaptureType = getElementTypes ()[Index];
625
- assert (ParamType == CaptureType);
626
- (void ) ParamType;
627
- (void ) CaptureType;
628
-
629
618
auto Root = ConventionSource.getMetadataSource (SourceBuilder);
630
619
auto Src = Fulfillment->Path .getMetadataSource (SourceBuilder, Root);
631
620
@@ -772,15 +761,14 @@ IRGenModule::getAddrOfCaptureDescriptor(SILFunction &Caller,
772
761
CanSILFunctionType OrigCalleeType,
773
762
CanSILFunctionType SubstCalleeType,
774
763
ArrayRef<Substitution> Subs,
775
- HeapLayout &Layout,
776
- unsigned FirstCaptureIndex) {
764
+ HeapLayout &Layout) {
777
765
if (!IRGen.Opts .EnableReflectionMetadata )
778
766
return llvm::Constant::getNullValue (CaptureDescriptorPtrTy);
779
767
780
768
llvm::SetVector<CanType> BuiltinTypes;
781
769
CaptureDescriptorBuilder builder (*this , BuiltinTypes, Caller,
782
770
OrigCalleeType, SubstCalleeType, Subs,
783
- Layout, FirstCaptureIndex );
771
+ Layout);
784
772
785
773
auto var = builder.emit ();
786
774
if (var)
0 commit comments