@@ -68,7 +68,7 @@ class TypeAttributes {
68
68
69
69
struct Convention {
70
70
StringRef Name = {};
71
- DeclName WitnessMethodProtocol = {};
71
+ DeclNameRef WitnessMethodProtocol = {};
72
72
StringRef ClangType = {};
73
73
// Carry the source location for diagnostics.
74
74
SourceLoc ClangTypeLoc = {};
@@ -78,7 +78,7 @@ class TypeAttributes {
78
78
// / Don't use this function if you are creating a C convention as you
79
79
// / probably need a ClangType field as well.
80
80
static Convention makeSwiftConvention (StringRef name) {
81
- return {name, DeclName (), " " , {}};
81
+ return {name, DeclNameRef (), " " , {}};
82
82
}
83
83
};
84
84
@@ -1057,23 +1057,24 @@ class DynamicReplacementAttr final
1057
1057
friend TrailingObjects;
1058
1058
friend class DynamicallyReplacedDeclRequest ;
1059
1059
1060
- DeclName ReplacedFunctionName;
1060
+ DeclNameRef ReplacedFunctionName;
1061
1061
LazyMemberLoader *Resolver = nullptr ;
1062
1062
uint64_t ResolverContextData;
1063
1063
1064
1064
// / Create an @_dynamicReplacement(for:) attribute written in the source.
1065
1065
DynamicReplacementAttr (SourceLoc atLoc, SourceRange baseRange,
1066
- DeclName replacedFunctionName, SourceRange parenRange);
1066
+ DeclNameRef replacedFunctionName,
1067
+ SourceRange parenRange);
1067
1068
1068
- DynamicReplacementAttr (DeclName name, AbstractFunctionDecl *f)
1069
+ DynamicReplacementAttr (DeclNameRef name, AbstractFunctionDecl *f)
1069
1070
: DeclAttribute(DAK_DynamicReplacement, SourceLoc(), SourceRange(),
1070
1071
/* Implicit=*/ false ),
1071
1072
ReplacedFunctionName (name),
1072
1073
Resolver(nullptr ), ResolverContextData(0 ) {
1073
1074
Bits.DynamicReplacementAttr .HasTrailingLocationInfo = false ;
1074
1075
}
1075
1076
1076
- DynamicReplacementAttr (DeclName name,
1077
+ DynamicReplacementAttr (DeclNameRef name,
1077
1078
LazyMemberLoader *Resolver = nullptr ,
1078
1079
uint64_t Data = 0 )
1079
1080
: DeclAttribute(DAK_DynamicReplacement, SourceLoc(), SourceRange(),
@@ -1100,18 +1101,18 @@ class DynamicReplacementAttr final
1100
1101
public:
1101
1102
static DynamicReplacementAttr *
1102
1103
create (ASTContext &Context, SourceLoc AtLoc, SourceLoc DynReplLoc,
1103
- SourceLoc LParenLoc, DeclName replacedFunction, SourceLoc RParenLoc);
1104
+ SourceLoc LParenLoc, DeclNameRef replacedFunction, SourceLoc RParenLoc);
1104
1105
1105
1106
static DynamicReplacementAttr *create (ASTContext &ctx,
1106
- DeclName replacedFunction,
1107
+ DeclNameRef replacedFunction,
1107
1108
AbstractFunctionDecl *replacedFuncDecl);
1108
1109
1109
1110
static DynamicReplacementAttr *create (ASTContext &ctx,
1110
- DeclName replacedFunction,
1111
+ DeclNameRef replacedFunction,
1111
1112
LazyMemberLoader *Resolver,
1112
1113
uint64_t Data);
1113
1114
1114
- DeclName getReplacedFunctionName () const {
1115
+ DeclNameRef getReplacedFunctionName () const {
1115
1116
return ReplacedFunctionName;
1116
1117
}
1117
1118
@@ -1630,8 +1631,8 @@ class OriginallyDefinedInAttr: public DeclAttribute {
1630
1631
};
1631
1632
1632
1633
// / A declaration name with location.
1633
- struct DeclNameWithLoc {
1634
- DeclName Name;
1634
+ struct DeclNameRefWithLoc {
1635
+ DeclNameRef Name;
1635
1636
DeclNameLoc Loc;
1636
1637
};
1637
1638
@@ -1652,9 +1653,9 @@ class DifferentiableAttr final
1652
1653
// / The number of parsed parameters specified in 'wrt:'.
1653
1654
unsigned NumParsedParameters = 0 ;
1654
1655
// / The JVP function.
1655
- Optional<DeclNameWithLoc > JVP;
1656
+ Optional<DeclNameRefWithLoc > JVP;
1656
1657
// / The VJP function.
1657
- Optional<DeclNameWithLoc > VJP;
1658
+ Optional<DeclNameRefWithLoc > VJP;
1658
1659
// / The JVP function (optional), resolved by the type checker if JVP name is
1659
1660
// / specified.
1660
1661
FuncDecl *JVPFunction = nullptr ;
@@ -1674,43 +1675,43 @@ class DifferentiableAttr final
1674
1675
explicit DifferentiableAttr (bool implicit, SourceLoc atLoc,
1675
1676
SourceRange baseRange, bool linear,
1676
1677
ArrayRef<ParsedAutoDiffParameter> parameters,
1677
- Optional<DeclNameWithLoc > jvp,
1678
- Optional<DeclNameWithLoc > vjp,
1678
+ Optional<DeclNameRefWithLoc > jvp,
1679
+ Optional<DeclNameRefWithLoc > vjp,
1679
1680
TrailingWhereClause *clause);
1680
1681
1681
1682
explicit DifferentiableAttr (Decl *original, bool implicit, SourceLoc atLoc,
1682
1683
SourceRange baseRange, bool linear,
1683
1684
IndexSubset *parameterIndices,
1684
- Optional<DeclNameWithLoc > jvp,
1685
- Optional<DeclNameWithLoc > vjp,
1685
+ Optional<DeclNameRefWithLoc > jvp,
1686
+ Optional<DeclNameRefWithLoc > vjp,
1686
1687
GenericSignature derivativeGenericSignature);
1687
1688
1688
1689
public:
1689
1690
static DifferentiableAttr *create (ASTContext &context, bool implicit,
1690
1691
SourceLoc atLoc, SourceRange baseRange,
1691
1692
bool linear,
1692
1693
ArrayRef<ParsedAutoDiffParameter> params,
1693
- Optional<DeclNameWithLoc > jvp,
1694
- Optional<DeclNameWithLoc > vjp,
1694
+ Optional<DeclNameRefWithLoc > jvp,
1695
+ Optional<DeclNameRefWithLoc > vjp,
1695
1696
TrailingWhereClause *clause);
1696
1697
1697
1698
static DifferentiableAttr *create (AbstractFunctionDecl *original,
1698
1699
bool implicit, SourceLoc atLoc,
1699
1700
SourceRange baseRange, bool linear,
1700
1701
IndexSubset *parameterIndices,
1701
- Optional<DeclNameWithLoc > jvp,
1702
- Optional<DeclNameWithLoc > vjp,
1702
+ Optional<DeclNameRefWithLoc > jvp,
1703
+ Optional<DeclNameRefWithLoc > vjp,
1703
1704
GenericSignature derivativeGenSig);
1704
1705
1705
1706
// / Get the optional 'jvp:' function name and location.
1706
1707
// / Use this instead of `getJVPFunction` to check whether the attribute has a
1707
1708
// / registered JVP.
1708
- Optional<DeclNameWithLoc > getJVP () const { return JVP; }
1709
+ Optional<DeclNameRefWithLoc > getJVP () const { return JVP; }
1709
1710
1710
1711
// / Get the optional 'vjp:' function name and location.
1711
1712
// / Use this instead of `getVJPFunction` to check whether the attribute has a
1712
1713
// / registered VJP.
1713
- Optional<DeclNameWithLoc > getVJP () const { return VJP; }
1714
+ Optional<DeclNameRefWithLoc > getVJP () const { return VJP; }
1714
1715
1715
1716
IndexSubset *getParameterIndices () const {
1716
1717
return ParameterIndices;
@@ -1775,7 +1776,7 @@ class DerivativeAttr final
1775
1776
friend TrailingObjects;
1776
1777
1777
1778
// / The original function name.
1778
- DeclNameWithLoc OriginalFunctionName;
1779
+ DeclNameRefWithLoc OriginalFunctionName;
1779
1780
// / The original function declaration, resolved by the type checker.
1780
1781
AbstractFunctionDecl *OriginalFunction = nullptr ;
1781
1782
// / The number of parsed parameters specified in 'wrt:'.
@@ -1786,23 +1787,24 @@ class DerivativeAttr final
1786
1787
Optional<AutoDiffDerivativeFunctionKind> Kind = None;
1787
1788
1788
1789
explicit DerivativeAttr (bool implicit, SourceLoc atLoc, SourceRange baseRange,
1789
- DeclNameWithLoc original,
1790
+ DeclNameRefWithLoc original,
1790
1791
ArrayRef<ParsedAutoDiffParameter> params);
1791
1792
1792
1793
explicit DerivativeAttr (bool implicit, SourceLoc atLoc, SourceRange baseRange,
1793
- DeclNameWithLoc original, IndexSubset *indices);
1794
+ DeclNameRefWithLoc original, IndexSubset *indices);
1794
1795
1795
1796
public:
1796
1797
static DerivativeAttr *create (ASTContext &context, bool implicit,
1797
1798
SourceLoc atLoc, SourceRange baseRange,
1798
- DeclNameWithLoc original,
1799
+ DeclNameRefWithLoc original,
1799
1800
ArrayRef<ParsedAutoDiffParameter> params);
1800
1801
1801
1802
static DerivativeAttr *create (ASTContext &context, bool implicit,
1802
1803
SourceLoc atLoc, SourceRange baseRange,
1803
- DeclNameWithLoc original, IndexSubset *indices);
1804
+ DeclNameRefWithLoc original,
1805
+ IndexSubset *indices);
1804
1806
1805
- DeclNameWithLoc getOriginalFunctionName () const {
1807
+ DeclNameRefWithLoc getOriginalFunctionName () const {
1806
1808
return OriginalFunctionName;
1807
1809
}
1808
1810
AbstractFunctionDecl *getOriginalFunction () const {
0 commit comments