[m-dev.] for review: GCC back-end: variable scoping
Tyson Dowd
trd at cs.mu.OZ.AU
Wed Jan 10 14:31:00 AEDT 2001
On 07-Jan-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> This is relative to my previously posted diff.
>
> Estimated hours taken: 12
>
> Implement proper variable scoping.
> This has two consequences:
> - the generated code uses less stack space, since various
> whose scope does not overlap get assigned the same stack slot
> - local variables now show up in gdb.
>
> mercury/compiler/gcc.m:
> New routines start_block and end_block.
>
> mercury/compiler/mlds_to_gcc.m:
> Call the new routines.
>
> gcc/mercury/mercury-gcc.c:
> - Call pushdecl() for builtin types and for local variables,
> to ensure that they get recorded in gcc's symbol tables,
> so that it will generate debugging information for them.
> - Fix a bug (copied from the toy.c example front-end)
> where it was clobbering the function DECL_ARGUMENTS field.
> - Simplify the spec1() macro by eliminating its first arg.
This also looks fine.
I was about to comment that this backend is actually relatively
simple, once you understand what all the C macros actually do.
So maintenance might not be as bad as I first thought.
But then I looked at the time taken for this one.
I assume it was tracking down the bug copied from from toy.c that took
all that time?
--
Tyson Dowd #
# Surreal humour isn't everyone's cup of fur.
trd at cs.mu.oz.au #
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list