[cfe-dev] Adding more info to builtin source types.

Douglas Gregor dgregor at apple.com
Mon Jan 18 14:39:58 CST 2010


On Jan 18, 2010, at 11:39 AM, Enea Zaffanella wrote:

> Douglas Gregor wrote:
>> Hello Enea,
>
> [...]
>
>> Okay, great. I committed your patch here:
>>    http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100118/026437.html 
>>  with a couple of tweaks:
>
> [...]
>
>> +  bool needsExtraLocalData() const {
>> +    BuiltinType::Kind bk = getTypePtr()->getKind();
>> +    return (bk >= BuiltinType::UShort && bk <= BuiltinType::UInt128)
>> +      || (bk >= BuiltinType::Short && bk <= BuiltinType::LongDouble)
>> +      || bk == BuiltinType::UChar
>> +      || bk == BuiltinType::SChar;
>> +  }
>> "float", "double", and "long double" don't need any extra data,  
>> since we'll always have a location for the type specifier (float or  
>> double) and the type is never implied by either a sign or a width.
>
> Actually, the use of 'mode' attributes can change the width of  
> floating point types, hence the need to store, even in this case,  
> the written type specifier, the written width specifier and a  
> Boolean flag for the presence of any 'mode' attribute.

Oh, I understand now, thanks. Fixed here:

	http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100118/026449.html

	- Doug


More information about the cfe-dev mailing list