@@ -1193,7 +1193,7 @@ class ExtensionDecl final : public GenericContext, public Decl,
1193
1193
// / extended nominal.
1194
1194
llvm::PointerIntPair<NominalTypeDecl *, 1 , bool > ExtendedNominal;
1195
1195
1196
- MutableArrayRef <TypeLoc> Inherited;
1196
+ ArrayRef <TypeLoc> Inherited;
1197
1197
1198
1198
// / The next extension in the linked list of extensions.
1199
1199
// /
@@ -1212,7 +1212,7 @@ class ExtensionDecl final : public GenericContext, public Decl,
1212
1212
friend class IterableDeclContext ;
1213
1213
1214
1214
ExtensionDecl (SourceLoc extensionLoc, TypeRepr *extendedType,
1215
- MutableArrayRef <TypeLoc> inherited,
1215
+ ArrayRef <TypeLoc> inherited,
1216
1216
DeclContext *parent,
1217
1217
TrailingWhereClause *trailingWhereClause);
1218
1218
@@ -1237,7 +1237,7 @@ class ExtensionDecl final : public GenericContext, public Decl,
1237
1237
// / Create a new extension declaration.
1238
1238
static ExtensionDecl *create (ASTContext &ctx, SourceLoc extensionLoc,
1239
1239
TypeRepr *extendedType,
1240
- MutableArrayRef <TypeLoc> inherited,
1240
+ ArrayRef <TypeLoc> inherited,
1241
1241
DeclContext *parent,
1242
1242
TrailingWhereClause *trailingWhereClause,
1243
1243
ClangNode clangNode = ClangNode());
@@ -1289,10 +1289,9 @@ class ExtensionDecl final : public GenericContext, public Decl,
1289
1289
1290
1290
// / Retrieve the set of protocols that this type inherits (i.e,
1291
1291
// / explicitly conforms to).
1292
- MutableArrayRef<TypeLoc> getInherited () { return Inherited; }
1293
1292
ArrayRef<TypeLoc> getInherited () const { return Inherited; }
1294
1293
1295
- void setInherited (MutableArrayRef <TypeLoc> i) { Inherited = i; }
1294
+ void setInherited (ArrayRef <TypeLoc> i) { Inherited = i; }
1296
1295
1297
1296
bool hasDefaultAccessLevel () const {
1298
1297
return Bits.ExtensionDecl .DefaultAndMaxAccessLevel != 0 ;
@@ -2405,12 +2404,12 @@ class ValueDecl : public Decl {
2405
2404
2406
2405
// / This is a common base class for declarations which declare a type.
2407
2406
class TypeDecl : public ValueDecl {
2408
- MutableArrayRef <TypeLoc> Inherited;
2407
+ ArrayRef <TypeLoc> Inherited;
2409
2408
2410
2409
protected:
2411
2410
TypeDecl (DeclKind K, llvm::PointerUnion<DeclContext *, ASTContext *> context,
2412
2411
Identifier name, SourceLoc NameLoc,
2413
- MutableArrayRef <TypeLoc> inherited) :
2412
+ ArrayRef <TypeLoc> inherited) :
2414
2413
ValueDecl (K, context, name, NameLoc), Inherited(inherited) {}
2415
2414
2416
2415
public:
@@ -2428,10 +2427,9 @@ class TypeDecl : public ValueDecl {
2428
2427
2429
2428
// / Retrieve the set of protocols that this type inherits (i.e,
2430
2429
// / explicitly conforms to).
2431
- MutableArrayRef<TypeLoc> getInherited () { return Inherited; }
2432
2430
ArrayRef<TypeLoc> getInherited () const { return Inherited; }
2433
2431
2434
- void setInherited (MutableArrayRef <TypeLoc> i) { Inherited = i; }
2432
+ void setInherited (ArrayRef <TypeLoc> i) { Inherited = i; }
2435
2433
2436
2434
static bool classof (const Decl *D) {
2437
2435
return D->getKind () >= DeclKind::First_TypeDecl &&
@@ -2456,7 +2454,7 @@ class GenericTypeDecl : public GenericContext, public TypeDecl {
2456
2454
public:
2457
2455
GenericTypeDecl (DeclKind K, DeclContext *DC,
2458
2456
Identifier name, SourceLoc nameLoc,
2459
- MutableArrayRef <TypeLoc> inherited,
2457
+ ArrayRef <TypeLoc> inherited,
2460
2458
GenericParamList *GenericParams);
2461
2459
2462
2460
// Resolve ambiguity due to multiple base classes.
@@ -2982,7 +2980,7 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
2982
2980
2983
2981
NominalTypeDecl (DeclKind K, DeclContext *DC, Identifier name,
2984
2982
SourceLoc NameLoc,
2985
- MutableArrayRef <TypeLoc> inherited,
2983
+ ArrayRef <TypeLoc> inherited,
2986
2984
GenericParamList *GenericParams) :
2987
2985
GenericTypeDecl (K, DC, name, NameLoc, inherited, GenericParams),
2988
2986
IterableDeclContext (IterableDeclContextKind::NominalTypeDecl)
@@ -3224,34 +3222,14 @@ class EnumDecl final : public NominalTypeDecl {
3224
3222
// Is the complete set of raw values type checked?
3225
3223
HasFixedRawValuesAndTypes = 1 << 2 ,
3226
3224
};
3227
-
3228
- struct {
3229
- // / The raw type and a bit to indicate whether the
3230
- // / raw was computed yet or not.
3231
- llvm::PointerIntPair<Type, 3 , OptionSet<SemanticInfoFlags>> RawTypeAndFlags;
3232
-
3233
- bool hasRawType () const {
3234
- return RawTypeAndFlags.getInt ().contains (HasComputedRawType);
3235
- }
3236
- void cacheRawType (Type ty) {
3237
- auto flags = RawTypeAndFlags.getInt () | HasComputedRawType;
3238
- RawTypeAndFlags.setPointerAndInt (ty, flags);
3239
- }
3240
-
3241
- bool hasFixedRawValues () const {
3242
- return RawTypeAndFlags.getInt ().contains (HasFixedRawValues);
3243
- }
3244
- bool hasCheckedRawValues () const {
3245
- return RawTypeAndFlags.getInt ().contains (HasFixedRawValuesAndTypes);
3246
- }
3247
- } LazySemanticInfo;
3225
+ OptionSet<SemanticInfoFlags> SemanticFlags;
3248
3226
3249
3227
friend class EnumRawValuesRequest ;
3250
3228
friend class EnumRawTypeRequest ;
3251
3229
3252
3230
public:
3253
3231
EnumDecl (SourceLoc EnumLoc, Identifier Name, SourceLoc NameLoc,
3254
- MutableArrayRef <TypeLoc> Inherited,
3232
+ ArrayRef <TypeLoc> Inherited,
3255
3233
GenericParamList *GenericParams, DeclContext *DC);
3256
3234
3257
3235
SourceLoc getStartLoc () const { return EnumLoc; }
@@ -3387,7 +3365,7 @@ class StructDecl final : public NominalTypeDecl {
3387
3365
3388
3366
public:
3389
3367
StructDecl (SourceLoc StructLoc, Identifier Name, SourceLoc NameLoc,
3390
- MutableArrayRef <TypeLoc> Inherited,
3368
+ ArrayRef <TypeLoc> Inherited,
3391
3369
GenericParamList *GenericParams, DeclContext *DC);
3392
3370
3393
3371
SourceLoc getStartLoc () const { return StructLoc; }
@@ -3526,7 +3504,7 @@ class ClassDecl final : public NominalTypeDecl {
3526
3504
3527
3505
public:
3528
3506
ClassDecl (SourceLoc ClassLoc, Identifier Name, SourceLoc NameLoc,
3529
- MutableArrayRef <TypeLoc> Inherited,
3507
+ ArrayRef <TypeLoc> Inherited,
3530
3508
GenericParamList *GenericParams, DeclContext *DC);
3531
3509
3532
3510
SourceLoc getStartLoc () const { return ClassLoc; }
@@ -3907,7 +3885,7 @@ class ProtocolDecl final : public NominalTypeDecl {
3907
3885
3908
3886
public:
3909
3887
ProtocolDecl (DeclContext *DC, SourceLoc ProtocolLoc, SourceLoc NameLoc,
3910
- Identifier Name, MutableArrayRef <TypeLoc> Inherited,
3888
+ Identifier Name, ArrayRef <TypeLoc> Inherited,
3911
3889
TrailingWhereClause *TrailingWhere);
3912
3890
3913
3891
using Decl::getASTContext;
0 commit comments