@@ -342,7 +342,7 @@ class alignas(1 << TypeAlignInBits) TypeBase {
342
342
// / Extra information which affects how the function is called, like
343
343
// / regparm and the calling convention.
344
344
ExtInfoBits : NumAFTExtInfoBits,
345
- HasUncommonInfo : 1 ,
345
+ HasClangTypeInfo : 1 ,
346
346
: NumPadBits,
347
347
NumParams : 16
348
348
);
@@ -365,7 +365,7 @@ class alignas(1 << TypeAlignInBits) TypeBase {
365
365
366
366
SWIFT_INLINE_BITFIELD (SILFunctionType, TypeBase, NumSILExtInfoBits+1 +3 +1 +2 +1 +1 ,
367
367
ExtInfoBits : NumSILExtInfoBits,
368
- HasUncommonInfo : 1 ,
368
+ HasClangTypeInfo : 1 ,
369
369
CalleeConvention : 3 ,
370
370
HasErrorResult : 1 ,
371
371
CoroutineKind : 2 ,
@@ -2987,7 +2987,7 @@ class AnyFunctionType : public TypeBase {
2987
2987
unsigned Bits; // Naturally sized for speed.
2988
2988
2989
2989
public:
2990
- class Uncommon {
2990
+ class ClangTypeInfo {
2991
2991
friend ExtInfo;
2992
2992
friend class AnyFunctionType ;
2993
2993
friend class FunctionType ;
@@ -2996,27 +2996,26 @@ class AnyFunctionType : public TypeBase {
2996
2996
// 2. The actual type being stored is [ignoring sugar] either a
2997
2997
// clang::PointerType, a clang::BlockPointerType, or a
2998
2998
// clang::ReferenceType which points to a clang::FunctionType.
2999
- const clang::Type *ClangFunctionType ;
2999
+ const clang::Type *type ;
3000
3000
3001
- bool empty () const { return !ClangFunctionType ; }
3002
- Uncommon (const clang::Type *type) : ClangFunctionType (type) {}
3001
+ bool empty () const { return !type ; }
3002
+ ClangTypeInfo (const clang::Type *type) : type (type) {}
3003
3003
3004
3004
public:
3005
3005
// / Use the ClangModuleLoader to print the Clang type as a string.
3006
- void printClangFunctionType (ClangModuleLoader *cml,
3007
- llvm::raw_ostream &os);
3006
+ void printType (ClangModuleLoader *cml, llvm::raw_ostream &os) const ;
3008
3007
};
3009
3008
3010
3009
private:
3011
- Uncommon Other;
3010
+ ClangTypeInfo Other;
3012
3011
3013
3012
static void assertIsFunctionType (const clang::Type *);
3014
3013
3015
- ExtInfo (unsigned Bits, Uncommon Other) : Bits(Bits), Other(Other) {
3014
+ ExtInfo (unsigned Bits, ClangTypeInfo Other) : Bits(Bits), Other(Other) {
3016
3015
// [TODO: Clang-type-plumbing] Assert that the pointer is non-null.
3017
3016
auto Rep = Representation (Bits & RepresentationMask);
3018
- if ((Rep == Representation::CFunctionPointer) && Other.ClangFunctionType )
3019
- assertIsFunctionType (Other.ClangFunctionType );
3017
+ if ((Rep == Representation::CFunctionPointer) && Other.type )
3018
+ assertIsFunctionType (Other.type );
3020
3019
}
3021
3020
3022
3021
friend AnyFunctionType;
@@ -3045,7 +3044,7 @@ class AnyFunctionType : public TypeBase {
3045
3044
| (Throws ? ThrowsMask : 0 )
3046
3045
| (((unsigned )DiffKind << DifferentiabilityMaskOffset)
3047
3046
& DifferentiabilityMask),
3048
- Uncommon (type)) {
3047
+ ClangTypeInfo (type)) {
3049
3048
}
3050
3049
3051
3050
bool isNoEscape () const { return Bits & NoEscapeMask; }
@@ -3065,9 +3064,9 @@ class AnyFunctionType : public TypeBase {
3065
3064
return Representation (rawRep);
3066
3065
}
3067
3066
3068
- // / Return the underlying Uncommon value if it is not the default value.
3069
- Optional<Uncommon> getUncommonInfo () const {
3070
- return Other.empty () ? Optional<Uncommon >() : Other;
3067
+ // / Get the underlying ClangTypeInfo value if it is not the default value.
3068
+ Optional<ClangTypeInfo> getClangTypeInfo () const {
3069
+ return Other.empty () ? Optional<ClangTypeInfo >() : Other;
3071
3070
}
3072
3071
3073
3072
bool hasSelfParam () const {
@@ -3124,7 +3123,7 @@ class AnyFunctionType : public TypeBase {
3124
3123
}
3125
3124
LLVM_NODISCARD
3126
3125
ExtInfo withClangFunctionType (const clang::Type *type) const {
3127
- return ExtInfo (Bits, Uncommon (type));
3126
+ return ExtInfo (Bits, ClangTypeInfo (type));
3128
3127
}
3129
3128
LLVM_NODISCARD
3130
3129
ExtInfo
@@ -3136,7 +3135,7 @@ class AnyFunctionType : public TypeBase {
3136
3135
}
3137
3136
3138
3137
std::pair<unsigned , const void *> getFuncAttrKey () const {
3139
- return std::make_pair (Bits, Other.ClangFunctionType );
3138
+ return std::make_pair (Bits, Other.type );
3140
3139
}
3141
3140
3142
3141
// / Put a SIL representation in the ExtInfo.
@@ -3166,13 +3165,13 @@ class AnyFunctionType : public TypeBase {
3166
3165
// / Create an AnyFunctionType.
3167
3166
// /
3168
3167
// / Subclasses are responsible for storing and retrieving the
3169
- // / ExtInfo::Uncommon value if one is present.
3168
+ // / ExtInfo::ClangTypeInfo value if one is present.
3170
3169
AnyFunctionType (TypeKind Kind, const ASTContext *CanTypeContext,
3171
3170
Type Output, RecursiveTypeProperties properties,
3172
3171
unsigned NumParams, ExtInfo Info)
3173
3172
: TypeBase(Kind, CanTypeContext, properties), Output(Output) {
3174
3173
Bits.AnyFunctionType .ExtInfoBits = Info.Bits ;
3175
- Bits.AnyFunctionType .HasUncommonInfo = Info.getUncommonInfo ().hasValue ();
3174
+ Bits.AnyFunctionType .HasClangTypeInfo = Info.getClangTypeInfo ().hasValue ();
3176
3175
Bits.AnyFunctionType .NumParams = NumParams;
3177
3176
assert (Bits.AnyFunctionType .NumParams == NumParams && " Params dropped!" );
3178
3177
// The use of both assert() and static_assert() is intentional.
@@ -3216,7 +3215,7 @@ class AnyFunctionType : public TypeBase {
3216
3215
GenericSignature getOptGenericSignature () const ;
3217
3216
3218
3217
bool hasClangFunctionType () const {
3219
- return Bits.AnyFunctionType .HasUncommonInfo ;
3218
+ return Bits.AnyFunctionType .HasClangTypeInfo ;
3220
3219
}
3221
3220
3222
3221
const clang::Type *getClangFunctionType () const ;
@@ -3435,15 +3434,15 @@ inline AnyFunctionType::CanYield AnyFunctionType::Yield::getCanonical() const {
3435
3434
class FunctionType final : public AnyFunctionType,
3436
3435
public llvm::FoldingSetNode,
3437
3436
private llvm::TrailingObjects<FunctionType, AnyFunctionType::Param,
3438
- AnyFunctionType::ExtInfo::Uncommon > {
3437
+ AnyFunctionType::ExtInfo::ClangTypeInfo > {
3439
3438
friend TrailingObjects;
3440
3439
3441
3440
3442
3441
size_t numTrailingObjects (OverloadToken<AnyFunctionType::Param>) const {
3443
3442
return getNumParams ();
3444
3443
}
3445
3444
3446
- size_t numTrailingObjects (OverloadToken<ExtInfo::Uncommon >) const {
3445
+ size_t numTrailingObjects (OverloadToken<ExtInfo::ClangTypeInfo >) const {
3447
3446
return hasClangFunctionType () ? 1 : 0 ;
3448
3447
}
3449
3448
@@ -3460,7 +3459,7 @@ class FunctionType final : public AnyFunctionType,
3460
3459
const clang::Type *getClangFunctionType () const {
3461
3460
if (!hasClangFunctionType ())
3462
3461
return nullptr ;
3463
- auto *type = getTrailingObjects<ExtInfo::Uncommon >()->ClangFunctionType ;
3462
+ auto *type = getTrailingObjects<ExtInfo::ClangTypeInfo >()->type ;
3464
3463
assert (type && " If the pointer was null, we shouldn't have stored it." );
3465
3464
return type;
3466
3465
}
@@ -4218,7 +4217,7 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
4218
4217
4219
4218
unsigned Bits; // Naturally sized for speed.
4220
4219
4221
- class Uncommon {
4220
+ class ClangTypeInfo {
4222
4221
friend ExtInfo;
4223
4222
friend class SILFunctionType ;
4224
4223
@@ -4228,22 +4227,21 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
4228
4227
const clang::FunctionType *ClangFunctionType;
4229
4228
4230
4229
bool empty () const { return !ClangFunctionType; }
4231
- Uncommon (const clang::FunctionType *type) : ClangFunctionType(type) {}
4230
+ ClangTypeInfo (const clang::FunctionType *type) : ClangFunctionType(type) {}
4232
4231
4233
4232
public:
4234
- // / Analog of AnyFunctionType::ExtInfo::Uncommon::printClangFunctionType.
4235
- void printClangFunctionType (ClangModuleLoader *cml,
4236
- llvm::raw_ostream &os) const ;
4233
+ // / Analog of AnyFunctionType::ExtInfo::ClangTypeInfo::printType.
4234
+ void printType (ClangModuleLoader *cml, llvm::raw_ostream &os) const ;
4237
4235
};
4238
4236
4239
- Uncommon Other;
4237
+ ClangTypeInfo Other;
4240
4238
4241
- ExtInfo (unsigned Bits, Uncommon Other) : Bits(Bits), Other(Other) {}
4239
+ ExtInfo (unsigned Bits, ClangTypeInfo Other) : Bits(Bits), Other(Other) {}
4242
4240
4243
4241
friend class SILFunctionType ;
4244
4242
public:
4245
4243
// Constructor with all defaults.
4246
- ExtInfo () : Bits(0 ), Other(Uncommon (nullptr )) { }
4244
+ ExtInfo () : Bits(0 ), Other(ClangTypeInfo (nullptr )) { }
4247
4245
4248
4246
// Constructor for polymorphic type.
4249
4247
ExtInfo (Representation rep, bool isPseudogeneric, bool isNoEscape,
@@ -4254,7 +4252,7 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
4254
4252
| (isNoEscape ? NoEscapeMask : 0 )
4255
4253
| (((unsigned )diffKind << DifferentiabilityMaskOffset)
4256
4254
& DifferentiabilityMask),
4257
- Uncommon (type)) {
4255
+ ClangTypeInfo (type)) {
4258
4256
}
4259
4257
4260
4258
static ExtInfo getThin () {
@@ -4287,9 +4285,9 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
4287
4285
return getSILFunctionLanguage (getRepresentation ());
4288
4286
}
4289
4287
4290
- // / Return the underlying Uncommon value if it is not the default value.
4291
- Optional<Uncommon> getUncommonInfo () const {
4292
- return Other.empty () ? Optional<Uncommon >() : Other;
4288
+ // / Get the underlying ClangTypeInfo value if it is not the default value.
4289
+ Optional<ClangTypeInfo> getClangTypeInfo () const {
4290
+ return Other.empty () ? Optional<ClangTypeInfo >() : Other;
4293
4291
}
4294
4292
4295
4293
bool hasSelfParam () const {
0 commit comments