@@ -2125,9 +2125,13 @@ class FunctionType : public Type {
2125
2125
QualType ResultType;
2126
2126
2127
2127
public:
2128
- // This class is used for passing around the information needed to
2129
- // construct a call. It is not actually used for storage, just for
2130
- // factoring together common arguments.
2128
+ // / ExtInfo - A class which abstracts out some details necessary for
2129
+ // / making a call.
2130
+ // /
2131
+ // / It is not actually used directly for storing this information in
2132
+ // / a FunctionType, although FunctionType does currently use the
2133
+ // / same bit-pattern.
2134
+ // /
2131
2135
// If you add a field (say Foo), other than the obvious places (both,
2132
2136
// constructors, compile failures), what you need to update is
2133
2137
// * Operator==
@@ -2141,16 +2145,21 @@ class FunctionType : public Type {
2141
2145
// * TypePrinter::PrintFunctionProto
2142
2146
// * AST read and write
2143
2147
// * Codegen
2144
-
2145
2148
class ExtInfo {
2149
+ // Feel free to rearrange or add bits, but if you go over 8,
2150
+ // you'll need to adjust both the Bits field below and
2151
+ // Type::FunctionTypeBitfields.
2152
+
2153
+ // | CC |noreturn|regparm
2154
+ // |0 .. 2| 3 |4 .. 6
2146
2155
enum { CallConvMask = 0x7 };
2147
2156
enum { NoReturnMask = 0x8 };
2148
2157
enum { RegParmMask = ~(CallConvMask | NoReturnMask),
2149
2158
RegParmOffset = 4 };
2150
2159
2151
- unsigned Bits;
2160
+ unsigned char Bits;
2152
2161
2153
- ExtInfo (unsigned Bits) : Bits(Bits) {}
2162
+ ExtInfo (unsigned Bits) : Bits(static_cast < unsigned char >( Bits) ) {}
2154
2163
2155
2164
friend class FunctionType ;
2156
2165
0 commit comments