[cfe-commits] r72598 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp
Douglas Gregor
dgregor at apple.com
Fri May 29 17:37:47 PDT 2009
On May 29, 2009, at 5:26 PM, Eli Friedman wrote:
> On Fri, May 29, 2009 at 5:14 PM, Douglas Gregor<dgregor at apple.com>
> wrote:
>>> --- cfe/trunk/lib/AST/Type.cpp (original)
>>> +++ cfe/trunk/lib/AST/Type.cpp Fri May 29 19:10:16 2009
>>> @@ -896,6 +896,19 @@
>>> return false;
>>> }
>>>
>>> +bool Type::isSpecifierType() const {
>>> + // Note that this intentionally does not use the canonical type.
>>> + switch (getTypeClass()) {
>>> + case Builtin:
>>> + case Record:
>>> + case Enum:
>>> + case Typedef:
>>> + return true;
>>> + default:
>>> + return false;
>>> + }
>>> +}
>>
>> Wouldn't it be easier to enumerate the non-specifier types?
>> Pointers, lvalue
>> references, rvalue references, array types, and then the result
>> types of
>> function types.
>
> There's pointers (regular, block, and member), extended qualifiers,
> references (l and r), array types (constant, incomplete, and
> variable), function types (with and without prototypes), and vector
> types (both regular and extended), off the top of my head. I think
> this way ends up being a bit shorter.
Then, from the list in isSpecifierType, we're missing: Complex,
TypeOfExpr, TypeOf, TemplateTypeParm, TemplateSpecialization,
QualifiedName, Typename, ObjCInterface, ObjCQualifiedInterface, and
ObjCQualifiedId.
- Doug
More information about the cfe-commits
mailing list