[cfe-dev] Type Uniquing with noexcept specifiers

Sebastian Redl sebastian.redl at getdesigned.at
Mon Mar 7 15:27:37 PST 2011


On 07.03.2011, at 23:57, Douglas Gregor wrote:

> 
> On Mar 7, 2011, at 12:46 PM, Sebastian Redl wrote:
> 
>> Hi,
>> 
>> With noexcept, FunctionProtoType gained an Expr* member. This is a problem for uniquing types: to profile an Expr, I need an ASTContext, but I can't get one into FunctionProtoType::Profile(). Other types with an Expr* member (e.g. DependentTypeOfExprType) store their own ASTContext, but I'm loath to store one in a type as common as FunctionProtoType.
>> 
>> Do I have a choice?
> 
> 
> In this case, I would add a FunctionProtoWithNoExceptType node that's a "hidden" subclass adding the Expr* and the ASTContext&. We've done this elsewhere, for rarely-used fields of common Type nodes.

Since FunctionProtoType is a variable-length type anyway, I've decided to put the data in there.

Thanks,
Sebastian



More information about the cfe-dev mailing list