This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [ast-optimizer-branch] simplifying C++
On Mon, 17 Jun 2002, Jason Merrill wrote:
> > Not pretty, but that's how we're dealing with statement expressions
> > now. Ideally, we should inline expand all these constructs.
>
> What do you mean? What would you expand inline?
>
I meant removing the block created by __with_cleanup(). Much
like we should convert:
a = ({ int x; x = j + 1; x })
into
int x;
x = j + 1;
a = x;
> > Would it be too inconvenient to replace the FOR_EXPR with T.3 in the
> > above code instead of having a break inside __with_cleanup?
>
> Do you mean the FOR_COND, i.e. something like this?
>
> {
> int i;
> bool T.3;
> T.3 = true;
> for (i = 42; T.3; i = i - 1)
> {
> A* T.1;
> bool T.2;
> A a;
> T.1 = &a;
> T.2 = i == 24;
> A::ctor (T.1, T.2);
> __with_cleanup (A::dtor (T.1))
> {
> T.3 = a.operator bool();
> if (T.3)
> {
> ...
> }
> }
> }
> }
>
Yup.