This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Push GENERIC farther into C/C++ front ends.


On Wed, Jun 16, 2004 at 11:17:39AM -0700, Mark Mitchell wrote:
> What *should* happen is that FOR_INIT_STMT (in the case where it 
> declares a new variable) would be a DECL, together with explicit 
> information about how that DECL is (a) initialized -- such as a 
> CALL_EXPR giving the constructor to call and the parameters to use -- 
> and (b) finalized -- such as a CALL_EXPR giving the destructor to call.

Sure.

> Then, during lowering (a phase we don't have yet), we'd convert it into 
> GENERIC.

Sure.

Actually, we have a teeny tiny stub of such a pass.  It converts
CLEANUP_STMT to one of TRY_{FINALLY,CLEANUP}_EXPR.  Due to, um,
curiosities of how TARGET_EXPRs are handled in the main gimplifier.

I'm considering expanding it to handle other small lowering, such
as BREAK, CONTINUE, SWITCH, IF.  This will, I believe, do two 
things.  First, it will allow some reuse of generic codes 
(SWITCH_EXPR instead of SWITCH_STMT).  Second, it will reduce the
recursion depth required to translate heavily nested else-if chains.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]