[cfe-dev] AST Representation of Conversions

Eli Friedman eli.friedman at gmail.com
Tue Jul 28 19:16:53 PDT 2009

On Tue, Jul 28, 2009 at 4:00 PM, Douglas Gregor<dgregor at apple.com> wrote:
> ImplicitConversionSequence is quite heavy, and I don't think that
> clients need that much information. It seems to me that we could get
> away with adding an enum (covering all the kinds of conversions you
> mentioned above) and a declaration (that points to a constructor or
> conversion function). The Expr class already has enough spare bits to
> store the enum, so CastExpr (and its descendents) would only have to
> grow by a single pointer. That, IMO, is an acceptable trade-off, since
> we'll be making CodeGen easier for C and possibly for C++.

I can't see how a pointer which would always be null in C code could
possibly make CodeGen easier for C code...

Note that we can always recalculate the appropriate declaration; it
might make sense to put the relevant code into the AST so it can be
shared between Sema and CodeGen.


More information about the cfe-dev mailing list