comp.lang.ada
 help / color / mirror / Atom feed
From: mrs@kithrup.com (Mike Stump)
Subject: Re: GNAT versions ( was :Ada compiler for PC?)
Date: 1999/05/07
Date: 1999-05-07T00:00:00+00:00	[thread overview]
Message-ID: <FBCAHD.Fqw@kithrup.com> (raw)
In-Reply-To: 7gs0d5$lvh$1@nnrp1.deja.com

In article <7gs0d5$lvh$1@nnrp1.deja.com>,
Robert Dewar  <robert_dewar@my-dejanews.com> wrote:

>I tried to understand what had been done for C++ but failed. Others
>here at ACT are still trying to do more merging here, but it is not
>easy.

I'd be happy to answer any questions.

>I found no high level interface oriented description of the
>mechanism used for C++.

>I believe this could only have been achieved if we had started with a
>fully documented high level design.

You make it sound like it can't be achieved.  :-(

Now, back to the first part...  There are roughly three routines to
call, one starts a region, one ends it, and the last to emit the
region handlers.  My hope was it would be easy to understand/use.

/* Start an exception handling region.  All instructions emitted after
   this point are considered to be part of the region until
   expand_eh_region_end () is invoked.  */

extern void expand_eh_region_start		PROTO((void));

/* End an exception handling region.  The information about the region
   is found on the top of ehstack.

   HANDLER is either the cleanup for the exception region, or if we're
   marking the end of a try block, HANDLER is integer_zero_node.

   HANDLER will be transformed to rtl when expand_leftover_cleanups ()
   is invoked.  */

extern void expand_eh_region_end		PROTO((tree));

/* Called from expand_exception_blocks and expand_end_catch_block to
   expand and pending handlers.  */

extern void expand_leftover_cleanups		PROTO((void));

The first two are meant to be fairly easy to use, maybe you can
explain what you found hard to use about them, and I can clarify.

The last is somewhat magical, and really should be buried deeper into
the backend.  Maybe if we can move the exception specifications into
the backend, the reason for not having it in the backend can be
removed.  But, if one reads what java does:

void
emit_handlers ()
{
  if (catch_clauses)
    {
      rtx funcend = gen_label_rtx ();
      emit_jump (funcend);

      emit_insns (catch_clauses);
      expand_leftover_cleanups ();

      emit_label (funcend);
    }
}

(thanks Per), you can just plug this in (or move it into the backend,
fix java to not include it), and just put in a call to emit_handlers.

That is the $0.05 tour.  :-) Now, admittedly, there are a few more
concepts to understand, like the cleanups in
TARGET_EXPR/expand_decl_cleanup _are_ run on an exception, for
example, but not that many more.




  parent reply	other threads:[~1999-05-07  0:00 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-17  0:00 Ada compiler for PC? Michael Feher
1999-04-17  0:00 ` Tom Moran
1999-04-18  0:00   ` Tom Moran
1999-04-20  0:00   ` Larry Kilgallen
1999-04-20  0:00     ` Robert Dewar
1999-04-20  0:00       ` Tom Moran
1999-04-20  0:00       ` GNAT versions ( was :Ada compiler for PC?) SpamSpamSpam
1999-04-21  0:00         ` Robert Dewar
1999-04-21  0:00           ` Glen
1999-04-21  0:00             ` Larry Kilgallen
1999-04-21  0:00               ` root
1999-04-22  0:00                 ` dennison
1999-04-22  0:00                 ` Robert Dewar
1999-04-22  0:00                   ` Glen
1999-04-23  0:00                     ` Robert Dewar
1999-04-22  0:00                       ` Russell Senior
1999-04-23  0:00                         ` Samuel Mize
1999-04-23  0:00                           ` Robert Dewar
1999-04-23  0:00                           ` Russell Senior
1999-04-23  0:00                             ` Robert Dewar
1999-04-23  0:00                               ` Larry Kilgallen
1999-04-23  0:00                             ` Samuel Mize
1999-04-25  0:00                               ` Robert Dewar
     [not found]                             ` <7fqld6$htu$1@nnrp1.dej <1999Apr23.172908.1@eisner>
1999-04-24  0:00                               ` Fergus Henderson
     [not found]                               ` <7frqmj$bg6$1@mulga.cs.mu.oz.au>
1999-04-24  0:00                                 ` Leslie Mikesell
1999-04-25  0:00                                   ` Robert Dewar
1999-04-25  0:00                                     ` Russ Allbery
1999-04-25  0:00                                       ` Robert Dewar
1999-04-25  0:00                                     ` Maciej Stachowiak
1999-04-26  0:00                                       ` Robert Dewar
1999-04-25  0:00                                         ` Maciej Stachowiak
1999-04-26  0:00                                         ` Per Bothner
1999-04-27  0:00                                           ` Robert Dewar
1999-04-27  0:00                                             ` Matthew Heaney
1999-04-28  0:00                                               ` Robert Dewar
1999-04-28  0:00                                                 ` David Kastrup
1999-04-28  0:00                                                   ` Robert Dewar
1999-04-29  0:00                                                 ` Per Bothner
1999-04-30  0:00                                                   ` Robert Dewar
1999-05-04  0:00                                                   ` Mike Stump
1999-05-05  0:00                                                     ` Robert Dewar
1999-05-06  0:00                                                       ` Mike Stump
1999-05-06  0:00                                                         ` Robert Dewar
1999-05-06  0:00                                                           ` Andi Kleen
1999-05-06  0:00                                                             ` Robert Dewar
1999-05-07  0:00                                                           ` Mike Stump [this message]
1999-05-07  0:00                                                             ` Robert Dewar
1999-05-08  0:00                                                       ` Pascal F. Martin
1999-05-08  0:00                                                         ` Robert Dewar
1999-05-08  0:00                                                           ` bill
1999-05-17  0:00                                                   ` Richard Kenner
1999-05-19  0:00                                                     ` Nick Roberts
1999-04-27  0:00                                           ` Robert Dewar
1999-04-27  0:00                                           ` Stan Shebs
1999-04-24  0:00                             ` Russ Allbery
1999-04-23  0:00                         ` Pascal Obry
1999-04-23  0:00                           ` dennison
1999-04-23  0:00                             ` Robert Dewar
1999-04-24  0:00                           ` Christopher Browne
1999-04-23  0:00                         ` bourguet
1999-04-25  0:00                           ` Geoffrey KEATING
1999-04-25  0:00                             ` Robert Dewar
1999-04-25  0:00                               ` EGCS & GNAT Was (Re: GNAT versions) David Starner
1999-04-26  0:00                                 ` Robert Dewar
1999-04-26  0:00                                 ` Robert Dewar
1999-04-26  0:00                               ` GNAT versions ( was :Ada compiler for PC?) Geoffrey KEATING
     [not found]                             ` <7fua23$fgh$1@nnrp1 <37234dca.a509d0d9@aasaa.ofe.org>
1999-04-26  0:00                               ` EGCS & GNAT Was (Re: GNAT versions) Larry Kilgallen
1999-04-26  0:00                             ` GNAT versions ( was :Ada compiler for PC?) bourguet
1999-04-24  0:00                       ` Ronald Cole
1999-04-21  0:00             ` Robert Dewar
1999-04-17  0:00 ` Ada compiler for PC? Steven Hovater
1999-04-18  0:00 ` Wilhelm Spickermann
     [not found] ` <7fua23$fgh$1@nnrp1 <37234dca.a <1999Apr25.201259.1@eisner>
1999-04-25  0:00   ` EGCS & GNAT Was (Re: GNAT versions) Leslie Mikesell
1999-04-26  0:00     ` Larry Kilgallen
1999-04-26  0:00       ` Robert Dewar
1999-05-04  0:00         ` Mike Stump
1999-05-05  0:00           ` Robert Dewar
1999-04-26  0:00     ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox