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

Lukasz Janyst ljanyst at cern.ch
Mon Dec 29 04:57:52 PST 2008


On Tue, Dec 23, 2008 at 5:58 AM, Chris Lattner <clattner at apple.com> wrote:
> 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.

   Ok, I will pay more attention next time.

> 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.

    Because the switch approach is more code and I'm a lazy person :))
And seriously, that's just a couple of extra bytes per context but
you're right that it might not have been the best idea to have an
array indexed with enums. I will redo the patch when I'm back from the
Xmas holidays.

Cheers,
   Lukasz



More information about the cfe-dev mailing list