[cfe-dev] [PATCH] Getting the builtin types from the ASTContext knowing their type

Chris Lattner clattner at apple.com
Mon Dec 22 20:58:29 PST 2008


On Dec 19, 2008, at 6:47 AM, Lukasz Janyst wrote:

> Hi,
>
>   I play with the type definitions in my code and I need to get a
> builtin type from an ASTContext in a situation when I just know a
> Builtin::Kind value associated to it. I'm not sure if want a patch
> like that but still I attach it.

Two things.  First, on a picky front, the patch uses a different  
convention for whitespace than the rest of clang.  Instead of things  
like "getBuiltinType( BuiltinType::Kind K )" please use  
"getBuiltinType(BuiltinType::Kind K)" etc.

Second, instead of building and maintaining an array, why not just  
make getBuiltinType switch on the kind and dispatch to the appropriate  
method?  That would eliminate the storage for BuiltinTypes.

> It also adds a CVR Qualifiers setter
> to clang::QualType.


Ok, applied (after formating changes):
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20081222/010456.html

-Chris





More information about the cfe-dev mailing list