[PATCH] rvalue reference implementation for C++0x

Andrew Pinski pinskia@gmail.com
Sun Mar 11 11:26:00 GMT 2007

On 3/11/07, Russell Yanofsky <russ@yanofsky.org> wrote:
> if they find new uses for  REFERENCE_TYPE nodes in the
> Fortran or Ada front ends, being able to
> distinguish between different kinds of reference types could prove
> useful there as well.

Not really because both of those front-ends have their own parsing
trees first and then convert to the middle-end trees unlike the C
family of languages front-end.

There is a notion of getting rid of also NON_LVALUE_EXPR which in a
way the same issue as adding a new rvalue/lvalue notation to the
middle-end.  If you look at what the middle-end does for lvalue/rvalue
you will see there are simple rules.  I really don't see why this type
be a C++ specific type.

If I understand the "extension" correctly:
int &&a = 1; is valid right?  Why not mark the decl as being an rvalue
reference type instead of making the whole type as a rvalue rerefence?
 It seems to take less memory usage.

In fact this is one reason why the C++ front-ends need to stop using
middle-end trees as it parse trees, it causes bloat in the middle-end.

I am thinking about splitting up the tree types so like the decl trees
they take less memory so introducing more flags into the middle-end
will force the reference type to take up more space.

--- Pinski

More information about the Gcc-patches mailing list