@@ -2134,10 +2134,11 @@ PrivateImportAttr *PrivateImportAttr::create(ASTContext &Ctxt, SourceLoc AtLoc,
21342134DynamicReplacementAttr::DynamicReplacementAttr (SourceLoc atLoc,
21352135 SourceRange baseRange,
21362136 DeclNameRef name,
2137+ DeclNameLoc nameLoc,
21372138 SourceRange parenRange)
21382139 : DeclAttribute(DeclAttrKind::DynamicReplacement, atLoc, baseRange,
21392140 /* Implicit=*/ false ),
2140- ReplacedFunctionName(name) {
2141+ ReplacedFunctionName(name), ReplacedFunctionNameLoc(nameLoc) {
21412142 Bits.DynamicReplacementAttr .HasTrailingLocationInfo = true ;
21422143 getTrailingLocations ()[0 ] = parenRange.Start ;
21432144 getTrailingLocations ()[1 ] = parenRange.End ;
@@ -2146,11 +2147,12 @@ DynamicReplacementAttr::DynamicReplacementAttr(SourceLoc atLoc,
21462147DynamicReplacementAttr *
21472148DynamicReplacementAttr::create (ASTContext &Ctx, SourceLoc AtLoc,
21482149 SourceLoc DynReplLoc, SourceLoc LParenLoc,
2149- DeclNameRef ReplacedFunction, SourceLoc RParenLoc) {
2150+ DeclNameRef ReplacedFunction,
2151+ DeclNameLoc nameLoc, SourceLoc RParenLoc) {
21502152 void *mem = Ctx.Allocate (totalSizeToAlloc<SourceLoc>(2 ),
21512153 alignof (DynamicReplacementAttr));
21522154 return new (mem) DynamicReplacementAttr (
2153- AtLoc, SourceRange (DynReplLoc, RParenLoc), ReplacedFunction,
2155+ AtLoc, SourceRange (DynReplLoc, RParenLoc), ReplacedFunction, nameLoc,
21542156 SourceRange (LParenLoc, RParenLoc));
21552157}
21562158
@@ -2506,12 +2508,15 @@ AbstractSpecializeAttr::AbstractSpecializeAttr(DeclAttrKind DK,
25062508 SpecializationKind kind,
25072509 GenericSignature specializedSignature,
25082510 DeclNameRef targetFunctionName,
2511+ DeclNameLoc targetFunctionNameLoc,
25092512 ArrayRef<Identifier> spiGroups,
25102513 ArrayRef<AvailableAttr *> availableAttrs,
25112514 size_t typeErasedParamsCount)
25122515 : DeclAttribute(DK, atLoc, range, /* Implicit=*/ clause == nullptr ),
25132516 trailingWhereClause(clause), specializedSignature(specializedSignature),
2514- targetFunctionName(targetFunctionName), numSPIGroups(spiGroups.size()),
2517+ targetFunctionName(targetFunctionName),
2518+ targetFunctionNameLoc(targetFunctionNameLoc),
2519+ numSPIGroups(spiGroups.size()),
25152520 numAvailableAttrs(availableAttrs.size()),
25162521 numTypeErasedParams(typeErasedParamsCount),
25172522 typeErasedParamsInitialized(false ) {
@@ -2533,6 +2538,7 @@ SpecializeAttr *SpecializeAttr::create(ASTContext &Ctx, SourceLoc atLoc,
25332538 TrailingWhereClause *clause,
25342539 bool exported, SpecializationKind kind,
25352540 DeclNameRef targetFunctionName,
2541+ DeclNameLoc targetFunctionNameLoc,
25362542 ArrayRef<Identifier> spiGroups,
25372543 ArrayRef<AvailableAttr *> availableAttrs,
25382544 GenericSignature specializedSignature) {
@@ -2556,7 +2562,8 @@ SpecializeAttr *SpecializeAttr::create(ASTContext &Ctx, SourceLoc atLoc,
25562562
25572563 return new (mem)
25582564 SpecializeAttr (atLoc, range, clause, exported, kind, specializedSignature,
2559- targetFunctionName, spiGroups, availableAttrs, typeErasedParamsCount);
2565+ targetFunctionName, targetFunctionNameLoc, spiGroups,
2566+ availableAttrs, typeErasedParamsCount);
25602567}
25612568
25622569SpecializeAttr *SpecializeAttr::create (ASTContext &ctx, bool exported,
@@ -2569,8 +2576,8 @@ SpecializeAttr *SpecializeAttr::create(ASTContext &ctx, bool exported,
25692576 spiGroups.size (), availableAttrs.size (), 0 );
25702577 void *mem = ctx.Allocate (size, alignof (SpecializeAttr));
25712578 return new (mem) SpecializeAttr (
2572- SourceLoc (), SourceRange (), nullptr , exported, kind,
2573- specializedSignature, targetFunctionName , spiGroups, availableAttrs, 0 );
2579+ SourceLoc (), SourceRange (), nullptr , exported, kind, specializedSignature,
2580+ targetFunctionName, DeclNameLoc () , spiGroups, availableAttrs, 0 );
25742581}
25752582
25762583SpecializeAttr *SpecializeAttr::create (
@@ -2584,7 +2591,8 @@ SpecializeAttr *SpecializeAttr::create(
25842591 void *mem = ctx.Allocate (size, alignof (SpecializeAttr));
25852592 auto *attr = new (mem) SpecializeAttr (
25862593 SourceLoc (), SourceRange (), nullptr , exported, kind, specializedSignature,
2587- targetFunctionName, spiGroups, availableAttrs, typeErasedParams.size ());
2594+ targetFunctionName, DeclNameLoc (), spiGroups, availableAttrs,
2595+ typeErasedParams.size ());
25882596 attr->setTypeErasedParams (typeErasedParams);
25892597 attr->setResolver (resolver, data);
25902598 return attr;
@@ -2597,6 +2605,7 @@ SpecializedAttr *SpecializedAttr::create(ASTContext &Ctx, SourceLoc atLoc,
25972605 TrailingWhereClause *clause,
25982606 bool exported, SpecializationKind kind,
25992607 DeclNameRef targetFunctionName,
2608+ DeclNameLoc targetFunctionNameLoc,
26002609 ArrayRef<Identifier> spiGroups,
26012610 ArrayRef<AvailableAttr *> availableAttrs,
26022611 GenericSignature specializedSignature) {
@@ -2620,7 +2629,8 @@ SpecializedAttr *SpecializedAttr::create(ASTContext &Ctx, SourceLoc atLoc,
26202629
26212630 return new (mem)
26222631 SpecializedAttr (atLoc, range, clause, exported, kind, specializedSignature,
2623- targetFunctionName, spiGroups, availableAttrs, typeErasedParamsCount);
2632+ targetFunctionName, targetFunctionNameLoc, spiGroups,
2633+ availableAttrs, typeErasedParamsCount);
26242634}
26252635
26262636SpecializedAttr *SpecializedAttr::create (ASTContext &ctx, bool exported,
@@ -2634,7 +2644,8 @@ SpecializedAttr *SpecializedAttr::create(ASTContext &ctx, bool exported,
26342644 void *mem = ctx.Allocate (size, alignof (SpecializedAttr));
26352645 return new (mem) SpecializedAttr (
26362646 SourceLoc (), SourceRange (), nullptr , exported, kind,
2637- specializedSignature, targetFunctionName, spiGroups, availableAttrs, 0 );
2647+ specializedSignature, targetFunctionName, DeclNameLoc (), spiGroups,
2648+ availableAttrs, 0 );
26382649}
26392650
26402651SpecializedAttr *SpecializedAttr::create (
@@ -2648,7 +2659,8 @@ SpecializedAttr *SpecializedAttr::create(
26482659 void *mem = ctx.Allocate (size, alignof (SpecializedAttr));
26492660 auto *attr = new (mem) SpecializedAttr (
26502661 SourceLoc (), SourceRange (), nullptr , exported, kind, specializedSignature,
2651- targetFunctionName, spiGroups, availableAttrs, typeErasedParams.size ());
2662+ targetFunctionName, DeclNameLoc (), spiGroups, availableAttrs,
2663+ typeErasedParams.size ());
26522664 attr->setTypeErasedParams (typeErasedParams);
26532665 attr->setResolver (resolver, data);
26542666 return attr;
0 commit comments