[cfe-dev] C++ Language Support Library

Sebastian Redl sebastian.redl at getdesigned.at
Sun Nov 9 11:42:13 PST 2008


Eli Friedman wrote:
> On Sun, Nov 9, 2008 at 8:23 AM, Sebastian Redl
> <sebastian.redl at getdesigned.at> wrote:
>   
>> 2) How do we access its types?
>> The types from the support library are accessed within Sema - play a
>> crucial role in some situations, even. There needs to be a nice
>> interface to declare and access these types. The C support types -
>> ptrdiff_t, size_t, etc. - are simply present in the ASTContext, always.
>>     
>
> Not true; we actually compute them as needed.  Computing those types
> isn't very expensive, though.
>   
Ah, OK.
>   
>> With the C++ types, this may be considered a waste.
>>     
>
> A waste in what sense?  We need to define them somewhere, and the
> ASTContext seems as good a place as any.  It's not as if putting the
> methods on the ASTContext restricts the implementation in any
> significant way.  And if computing the types has a significant cost,
> we can cache them.
>   
I meant pre-computing them, before they are first used, would be a waste.
> All right, so ignoring the concept stuff, all we need is type_info,
> nullptr_t, and maybe a few of the exception types depending on the
> implementation.  I'd say just add them to the ASTContext.
>   
I need to do that, and I also need to add them to the lookup table of Sema.

Sebastian



More information about the cfe-dev mailing list