[cfe-dev] Tentative typeid Parser/AST implementation

Daniel Dunbar daniel at zuster.org
Tue Nov 11 09:48:09 PST 2008


On Tue, Nov 11, 2008 at 8:09 AM, Sebastian Redl
<sebastian.redl at getdesigned.at> wrote:
> Chris Lattner wrote:
>>
>> On Nov 10, 2008, at 2:13 PM, Sebastian Redl wrote:
>>
>>> Chris Lattner wrote:
>>>>
>>>> Hi Sebastian,
>>>>
>>>> I have another question for you.  :)  In this node, you're taking the
>>>> approach of handling exprs and types with the same AST node class.  In
>>>> sizeof/alignof, we have different nodes for the expr/type case.
>>>>
>>>> I agree with Doug that splitting up UnaryOperator (and friends) is
>>>> goodness, but I'm not sure that having the node handle both expr and type
>>>> subexpressions is a good approach.  What do you think?
>>>
>>> I could have made a TypeidExpr and a TypeidOfTypeExpr and
>>> TypeidOfExprExpr that derive from it, but I felt that it was overkill.
>>
>> I don't really care one way or the other, as long as we're consistent.  Do
>> you think one approach is better than the other?  If you like merging the
>> two together, would you be willing to change sizeof/alignof to match?
>>
>> -Chris
>
> Here's the patch. Passes all regressions, but this was an ugly,
> wide-reaching change, so perhaps some people can take a look at it before I
> commit. I do feel the code is improved now.

You're right this was an ugly change! :)

Thanks for taking it on though, patch looks good to me.

 - Daniel

> Sebastian
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>



More information about the cfe-dev mailing list