@@ -345,7 +345,7 @@ class alignas(1 << TypeAlignInBits) TypeBase {
345
345
// / Extra information which affects how the function is called, like
346
346
// / regparm and the calling convention.
347
347
ExtInfoBits : NumAFTExtInfoBits,
348
- HasUncommonInfo : 1 ,
348
+ HasClangTypeInfo : 1 ,
349
349
: NumPadBits,
350
350
NumParams : 16
351
351
);
@@ -368,7 +368,7 @@ class alignas(1 << TypeAlignInBits) TypeBase {
368
368
369
369
SWIFT_INLINE_BITFIELD (SILFunctionType, TypeBase, NumSILExtInfoBits+1 +3 +1 +2 +1 +1 ,
370
370
ExtInfoBits : NumSILExtInfoBits,
371
- HasUncommonInfo : 1 ,
371
+ HasClangTypeInfo : 1 ,
372
372
CalleeConvention : 3 ,
373
373
HasErrorResult : 1 ,
374
374
CoroutineKind : 2 ,
@@ -2990,7 +2990,7 @@ class AnyFunctionType : public TypeBase {
2990
2990
unsigned Bits; // Naturally sized for speed.
2991
2991
2992
2992
public:
2993
- class Uncommon {
2993
+ class ClangTypeInfo {
2994
2994
friend ExtInfo;
2995
2995
friend class AnyFunctionType ;
2996
2996
friend class FunctionType ;
@@ -2999,27 +2999,26 @@ class AnyFunctionType : public TypeBase {
2999
2999
// 2. The actual type being stored is [ignoring sugar] either a
3000
3000
// clang::PointerType, a clang::BlockPointerType, or a
3001
3001
// clang::ReferenceType which points to a clang::FunctionType.
3002
- const clang::Type *ClangFunctionType ;
3002
+ const clang::Type *type ;
3003
3003
3004
- bool empty () const { return !ClangFunctionType ; }
3005
- Uncommon (const clang::Type *type) : ClangFunctionType (type) {}
3004
+ bool empty () const { return !type ; }
3005
+ ClangTypeInfo (const clang::Type *type) : type (type) {}
3006
3006
3007
3007
public:
3008
3008
// / Use the ClangModuleLoader to print the Clang type as a string.
3009
- void printClangFunctionType (ClangModuleLoader *cml,
3010
- llvm::raw_ostream &os);
3009
+ void printType (ClangModuleLoader *cml, llvm::raw_ostream &os) const ;
3011
3010
};
3012
3011
3013
3012
private:
3014
- Uncommon Other;
3013
+ ClangTypeInfo Other;
3015
3014
3016
3015
static void assertIsFunctionType (const clang::Type *);
3017
3016
3018
- ExtInfo (unsigned Bits, Uncommon Other) : Bits(Bits), Other(Other) {
3017
+ ExtInfo (unsigned Bits, ClangTypeInfo Other) : Bits(Bits), Other(Other) {
3019
3018
// [TODO: Clang-type-plumbing] Assert that the pointer is non-null.
3020
3019
auto Rep = Representation (Bits & RepresentationMask);
3021
- if ((Rep == Representation::CFunctionPointer) && Other.ClangFunctionType )
3022
- assertIsFunctionType (Other.ClangFunctionType );
3020
+ if ((Rep == Representation::CFunctionPointer) && Other.type )
3021
+ assertIsFunctionType (Other.type );
3023
3022
}
3024
3023
3025
3024
friend AnyFunctionType;
@@ -3048,7 +3047,7 @@ class AnyFunctionType : public TypeBase {
3048
3047
| (Throws ? ThrowsMask : 0 )
3049
3048
| (((unsigned )DiffKind << DifferentiabilityMaskOffset)
3050
3049
& DifferentiabilityMask),
3051
- Uncommon (type)) {
3050
+ ClangTypeInfo (type)) {
3052
3051
}
3053
3052
3054
3053
bool isNoEscape () const { return Bits & NoEscapeMask; }
@@ -3068,9 +3067,9 @@ class AnyFunctionType : public TypeBase {
3068
3067
return Representation (rawRep);
3069
3068
}
3070
3069
3071
- // / Return the underlying Uncommon value if it is not the default value.
3072
- Optional<Uncommon> getUncommonInfo () const {
3073
- return Other.empty () ? Optional<Uncommon >() : Other;
3070
+ // / Get the underlying ClangTypeInfo value if it is not the default value.
3071
+ Optional<ClangTypeInfo> getClangTypeInfo () const {
3072
+ return Other.empty () ? Optional<ClangTypeInfo >() : Other;
3074
3073
}
3075
3074
3076
3075
bool hasSelfParam () const {
@@ -3127,7 +3126,7 @@ class AnyFunctionType : public TypeBase {
3127
3126
}
3128
3127
LLVM_NODISCARD
3129
3128
ExtInfo withClangFunctionType (const clang::Type *type) const {
3130
- return ExtInfo (Bits, Uncommon (type));
3129
+ return ExtInfo (Bits, ClangTypeInfo (type));
3131
3130
}
3132
3131
LLVM_NODISCARD
3133
3132
ExtInfo
@@ -3139,7 +3138,7 @@ class AnyFunctionType : public TypeBase {
3139
3138
}
3140
3139
3141
3140
std::pair<unsigned , const void *> getFuncAttrKey () const {
3142
- return std::make_pair (Bits, Other.ClangFunctionType );
3141
+ return std::make_pair (Bits, Other.type );
3143
3142
}
3144
3143
3145
3144
// / Put a SIL representation in the ExtInfo.
@@ -3169,13 +3168,13 @@ class AnyFunctionType : public TypeBase {
3169
3168
// / Create an AnyFunctionType.
3170
3169
// /
3171
3170
// / Subclasses are responsible for storing and retrieving the
3172
- // / ExtInfo::Uncommon value if one is present.
3171
+ // / ExtInfo::ClangTypeInfo value if one is present.
3173
3172
AnyFunctionType (TypeKind Kind, const ASTContext *CanTypeContext,
3174
3173
Type Output, RecursiveTypeProperties properties,
3175
3174
unsigned NumParams, ExtInfo Info)
3176
3175
: TypeBase(Kind, CanTypeContext, properties), Output(Output) {
3177
3176
Bits.AnyFunctionType .ExtInfoBits = Info.Bits ;
3178
- Bits.AnyFunctionType .HasUncommonInfo = Info.getUncommonInfo ().hasValue ();
3177
+ Bits.AnyFunctionType .HasClangTypeInfo = Info.getClangTypeInfo ().hasValue ();
3179
3178
Bits.AnyFunctionType .NumParams = NumParams;
3180
3179
assert (Bits.AnyFunctionType .NumParams == NumParams && " Params dropped!" );
3181
3180
// The use of both assert() and static_assert() is intentional.
@@ -3219,7 +3218,7 @@ class AnyFunctionType : public TypeBase {
3219
3218
GenericSignature getOptGenericSignature () const ;
3220
3219
3221
3220
bool hasClangFunctionType () const {
3222
- return Bits.AnyFunctionType .HasUncommonInfo ;
3221
+ return Bits.AnyFunctionType .HasClangTypeInfo ;
3223
3222
}
3224
3223
3225
3224
const clang::Type *getClangFunctionType () const ;
@@ -3438,15 +3437,15 @@ inline AnyFunctionType::CanYield AnyFunctionType::Yield::getCanonical() const {
3438
3437
class FunctionType final : public AnyFunctionType,
3439
3438
public llvm::FoldingSetNode,
3440
3439
private llvm::TrailingObjects<FunctionType, AnyFunctionType::Param,
3441
- AnyFunctionType::ExtInfo::Uncommon > {
3440
+ AnyFunctionType::ExtInfo::ClangTypeInfo > {
3442
3441
friend TrailingObjects;
3443
3442
3444
3443
3445
3444
size_t numTrailingObjects (OverloadToken<AnyFunctionType::Param>) const {
3446
3445
return getNumParams ();
3447
3446
}
3448
3447
3449
- size_t numTrailingObjects (OverloadToken<ExtInfo::Uncommon >) const {
3448
+ size_t numTrailingObjects (OverloadToken<ExtInfo::ClangTypeInfo >) const {
3450
3449
return hasClangFunctionType () ? 1 : 0 ;
3451
3450
}
3452
3451
@@ -3463,7 +3462,7 @@ class FunctionType final : public AnyFunctionType,
3463
3462
const clang::Type *getClangFunctionType () const {
3464
3463
if (!hasClangFunctionType ())
3465
3464
return nullptr ;
3466
- auto *type = getTrailingObjects<ExtInfo::Uncommon >()->ClangFunctionType ;
3465
+ auto *type = getTrailingObjects<ExtInfo::ClangTypeInfo >()->type ;
3467
3466
assert (type && " If the pointer was null, we shouldn't have stored it." );
3468
3467
return type;
3469
3468
}
@@ -4221,7 +4220,7 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
4221
4220
4222
4221
unsigned Bits; // Naturally sized for speed.
4223
4222
4224
- class Uncommon {
4223
+ class ClangTypeInfo {
4225
4224
friend ExtInfo;
4226
4225
friend class SILFunctionType ;
4227
4226
@@ -4231,22 +4230,21 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
4231
4230
const clang::FunctionType *ClangFunctionType;
4232
4231
4233
4232
bool empty () const { return !ClangFunctionType; }
4234
- Uncommon (const clang::FunctionType *type) : ClangFunctionType(type) {}
4233
+ ClangTypeInfo (const clang::FunctionType *type) : ClangFunctionType(type) {}
4235
4234
4236
4235
public:
4237
- // / Analog of AnyFunctionType::ExtInfo::Uncommon::printClangFunctionType.
4238
- void printClangFunctionType (ClangModuleLoader *cml,
4239
- llvm::raw_ostream &os) const ;
4236
+ // / Analog of AnyFunctionType::ExtInfo::ClangTypeInfo::printType.
4237
+ void printType (ClangModuleLoader *cml, llvm::raw_ostream &os) const ;
4240
4238
};
4241
4239
4242
- Uncommon Other;
4240
+ ClangTypeInfo Other;
4243
4241
4244
- ExtInfo (unsigned Bits, Uncommon Other) : Bits(Bits), Other(Other) {}
4242
+ ExtInfo (unsigned Bits, ClangTypeInfo Other) : Bits(Bits), Other(Other) {}
4245
4243
4246
4244
friend class SILFunctionType ;
4247
4245
public:
4248
4246
// Constructor with all defaults.
4249
- ExtInfo () : Bits(0 ), Other(Uncommon (nullptr )) { }
4247
+ ExtInfo () : Bits(0 ), Other(ClangTypeInfo (nullptr )) { }
4250
4248
4251
4249
// Constructor for polymorphic type.
4252
4250
ExtInfo (Representation rep, bool isPseudogeneric, bool isNoEscape,
@@ -4257,7 +4255,7 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
4257
4255
| (isNoEscape ? NoEscapeMask : 0 )
4258
4256
| (((unsigned )diffKind << DifferentiabilityMaskOffset)
4259
4257
& DifferentiabilityMask),
4260
- Uncommon (type)) {
4258
+ ClangTypeInfo (type)) {
4261
4259
}
4262
4260
4263
4261
static ExtInfo getThin () {
@@ -4290,9 +4288,9 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
4290
4288
return getSILFunctionLanguage (getRepresentation ());
4291
4289
}
4292
4290
4293
- // / Return the underlying Uncommon value if it is not the default value.
4294
- Optional<Uncommon> getUncommonInfo () const {
4295
- return Other.empty () ? Optional<Uncommon >() : Other;
4291
+ // / Get the underlying ClangTypeInfo value if it is not the default value.
4292
+ Optional<ClangTypeInfo> getClangTypeInfo () const {
4293
+ return Other.empty () ? Optional<ClangTypeInfo >() : Other;
4296
4294
}
4297
4295
4298
4296
bool hasSelfParam () const {
0 commit comments