@@ -369,21 +369,14 @@ class alignas(1 << DeclAlignInBits) Decl {
369
369
IsPropertyWrapperBackingProperty : 1
370
370
);
371
371
372
- SWIFT_INLINE_BITFIELD (ParamDecl, VarDecl, 1 +2 +1 + NumDefaultArgumentKindBits,
372
+ SWIFT_INLINE_BITFIELD (ParamDecl, VarDecl, 1 +2 +NumDefaultArgumentKindBits,
373
373
// / Whether we've computed the specifier yet.
374
374
SpecifierComputed : 1 ,
375
375
376
376
// / The specifier associated with this parameter. This determines
377
377
// / the storage semantics of the value e.g. mutability.
378
378
Specifier : 2 ,
379
379
380
- // / True if the type is implicitly specified in the source, but this has an
381
- // / apparently valid typeRepr. This is used in accessors, which look like:
382
- // / set (value) {
383
- // / but need to get the typeRepr from the property as a whole so Sema can
384
- // / resolve the type.
385
- IsTypeLocImplicit : 1 ,
386
-
387
380
// / Information about a symbolic default argument, like #file.
388
381
defaultArgumentKind : NumDefaultArgumentKindBits
389
382
);
@@ -2985,9 +2978,6 @@ class TypeAliasDecl : public GenericTypeDecl {
2985
2978
// / Retrieve a sugared interface type containing the structure of the interface
2986
2979
// / type before any semantic validation has occured.
2987
2980
Type getStructuralType () const ;
2988
-
2989
- // / Set the interface type of this typealias declaration from the underlying type.
2990
- void computeType ();
2991
2981
2992
2982
bool isCompatibilityAlias () const {
2993
2983
return Bits.TypeAliasDecl .IsCompatibilityAlias ;
@@ -3176,10 +3166,6 @@ class AssociatedTypeDecl : public AbstractTypeParamDecl {
3176
3166
TrailingWhere = trailingWhereClause;
3177
3167
}
3178
3168
3179
- // / Set the interface type of this associated type declaration to a dependent
3180
- // / member type of 'Self'.
3181
- void computeType ();
3182
-
3183
3169
// / Retrieve the associated type "anchor", which is the associated type
3184
3170
// / declaration that will be used to describe this associated type in the
3185
3171
// / ABI.
@@ -3369,10 +3355,6 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
3369
3355
Bits.NominalTypeDecl .AddedImplicitInitializers = true ;
3370
3356
}
3371
3357
3372
- // / Set the interface type of this nominal type to the metatype of the
3373
- // / declared interface type.
3374
- void computeType ();
3375
-
3376
3358
// / getDeclaredType - Retrieve the type declared by this entity, without
3377
3359
// / any generic parameters bound if this is a generic type.
3378
3360
Type getDeclaredType () const ;
@@ -4804,8 +4786,7 @@ class VarDecl : public AbstractStorageDecl {
4804
4786
bool issCaptureList, SourceLoc nameLoc, Identifier name,
4805
4787
DeclContext *dc, StorageIsMutable_t supportsMutation);
4806
4788
4807
- // / This is the type specified, including location information.
4808
- TypeLoc typeLoc;
4789
+ TypeRepr *ParentRepr = nullptr ;
4809
4790
4810
4791
Type typeInContext;
4811
4792
@@ -4825,8 +4806,10 @@ class VarDecl : public AbstractStorageDecl {
4825
4806
return hasName () ? getBaseName ().getIdentifier ().str () : " _" ;
4826
4807
}
4827
4808
4828
- TypeLoc &getTypeLoc () { return typeLoc; }
4829
- TypeLoc getTypeLoc () const { return typeLoc; }
4809
+ // / Retrieve the TypeRepr corresponding to the parsed type of the parent
4810
+ // / pattern, if it exists.
4811
+ TypeRepr *getTypeRepr () const { return ParentRepr; }
4812
+ void setTypeRepr (TypeRepr *repr) { ParentRepr = repr; }
4830
4813
4831
4814
bool hasType () const {
4832
4815
// We have a type if either the type has been computed already or if
@@ -5201,10 +5184,8 @@ class ParamDecl : public VarDecl {
5201
5184
Identifier argumentName, SourceLoc parameterNameLoc,
5202
5185
Identifier parameterName, DeclContext *dc);
5203
5186
5204
- // / Clone constructor, allocates a new ParamDecl identical to the first.
5205
- // / Intentionally not defined as a typical copy constructor to avoid
5206
- // / accidental copies.
5207
- ParamDecl (ParamDecl *PD, bool withTypes);
5187
+ // / Create a new ParamDecl identical to the first except without the interface type.
5188
+ static ParamDecl *cloneWithoutType (const ASTContext &Ctx, ParamDecl *PD);
5208
5189
5209
5190
// / Retrieve the argument (API) name for this function parameter.
5210
5191
Identifier getArgumentName () const { return ArgumentName; }
@@ -5221,10 +5202,7 @@ class ParamDecl : public VarDecl {
5221
5202
SourceLoc getParameterNameLoc () const { return ParameterNameLoc; }
5222
5203
5223
5204
SourceLoc getSpecifierLoc () const { return SpecifierLoc; }
5224
-
5225
- bool isTypeLocImplicit () const { return Bits.ParamDecl .IsTypeLocImplicit ; }
5226
- void setIsTypeLocImplicit (bool val) { Bits.ParamDecl .IsTypeLocImplicit = val; }
5227
-
5205
+
5228
5206
DefaultArgumentKind getDefaultArgumentKind () const {
5229
5207
return static_cast <DefaultArgumentKind>(Bits.ParamDecl .defaultArgumentKind );
5230
5208
}
@@ -5495,10 +5473,6 @@ class SubscriptDecl : public GenericContext, public AbstractStorageDecl {
5495
5473
TypeLoc &getElementTypeLoc () { return ElementTy; }
5496
5474
const TypeLoc &getElementTypeLoc () const { return ElementTy; }
5497
5475
5498
- // / Compute the interface type of this subscript from the parameter and
5499
- // / element types.
5500
- void computeType ();
5501
-
5502
5476
// / Determine the kind of Objective-C subscripting this declaration
5503
5477
// / implies.
5504
5478
ObjCSubscriptKind getObjCSubscriptKind () const ;
@@ -6369,10 +6343,6 @@ class EnumElementDecl : public DeclContext, public ValueDecl {
6369
6343
return hasName () ? getBaseName ().getIdentifier ().str () : " _" ;
6370
6344
}
6371
6345
6372
- // / Set the interface type of this enum element to the constructor function
6373
- // / type; (Self.Type) -> Self or (Self.Type) -> (Args...) -> Self.
6374
- void computeType ();
6375
-
6376
6346
Type getArgumentInterfaceType () const ;
6377
6347
6378
6348
void setParameterList (ParameterList *params);
0 commit comments