@@ -525,20 +525,18 @@ class CaptureDescriptorBuilder : public ReflectionMetadataBuilder {
525525 CanSILFunctionType SubstCalleeType;
526526 ArrayRef<Substitution> Subs;
527527 HeapLayout &Layout;
528- unsigned FirstCaptureIndex;
529528public:
530529 CaptureDescriptorBuilder (IRGenModule &IGM,
531530 llvm::SetVector<CanType> &BuiltinTypes,
532531 SILFunction &Caller,
533532 CanSILFunctionType OrigCalleeType,
534533 CanSILFunctionType SubstCalleeType,
535534 ArrayRef<Substitution> Subs,
536- HeapLayout &Layout,
537- unsigned FirstCaptureIndex)
535+ HeapLayout &Layout)
538536 : ReflectionMetadataBuilder(IGM, BuiltinTypes),
539537 Caller (Caller), OrigCalleeType(OrigCalleeType),
540538 SubstCalleeType(SubstCalleeType), Subs(Subs),
541- Layout(Layout), FirstCaptureIndex(FirstCaptureIndex) {}
539+ Layout(Layout) {}
542540
543541 using MetadataSourceMap
544542 = std::vector<std::pair<CanType, const reflection::MetadataSource*>>;
@@ -617,15 +615,6 @@ class CaptureDescriptorBuilder : public ReflectionMetadataBuilder {
617615 // dereferencing an isa pointer or a generic argument). Record
618616 // the path. We assume captured values map 1-1 with function
619617 // 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-
629618 auto Root = ConventionSource.getMetadataSource (SourceBuilder);
630619 auto Src = Fulfillment->Path .getMetadataSource (SourceBuilder, Root);
631620
@@ -772,15 +761,14 @@ IRGenModule::getAddrOfCaptureDescriptor(SILFunction &Caller,
772761 CanSILFunctionType OrigCalleeType,
773762 CanSILFunctionType SubstCalleeType,
774763 ArrayRef<Substitution> Subs,
775- HeapLayout &Layout,
776- unsigned FirstCaptureIndex) {
764+ HeapLayout &Layout) {
777765 if (!IRGen.Opts .EnableReflectionMetadata )
778766 return llvm::Constant::getNullValue (CaptureDescriptorPtrTy);
779767
780768 llvm::SetVector<CanType> BuiltinTypes;
781769 CaptureDescriptorBuilder builder (*this , BuiltinTypes, Caller,
782770 OrigCalleeType, SubstCalleeType, Subs,
783- Layout, FirstCaptureIndex );
771+ Layout);
784772
785773 auto var = builder.emit ();
786774 if (var)
0 commit comments