Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[CVS ci] more PIR codegen improvements

2 views
Skip to first unread message

Leopold Toetsch

unread,
Mar 22, 2004, 11:42:39 AM3/22/04
to P6I
* end is now inserted in @MAIN if missing
* in @MAIN P1 isn't moved around
* -Oc: replace savetop with up to 3 pushtopX ops

It's a good idea to declare the main function:

.sub _main @MAIN
...

.end

leo

Sterling Hughes

unread,
Mar 22, 2004, 12:25:53 PM3/22/04
to Leopold Toetsch, P6I

On Mar 22, 2004, at 11:42 AM, Leopold Toetsch wrote:

> * end is now inserted in @MAIN if missing

perhaps this should be a compiler warning instead?

-sterling

Leopold Toetsch

unread,
Mar 22, 2004, 1:11:00 PM3/22/04
to Sterling Hughes, perl6-i...@perl.org
Sterling Hughes <ster...@php.net> wrote:

If both C<@MAIN> and C<end> are missing, we could compile a module. So
sometimes you'll get a warning and sometimes not. Not good IMHO.

Inserting C<end> in C<@main> matches the automatically inserted
C<invoke P1> in subs.

> -sterling

leo

Dan Sugalski

unread,
Mar 22, 2004, 2:31:12 PM3/22/04
to perl6-i...@perl.org
At 7:11 PM +0100 3/22/04, Leopold Toetsch wrote:
>Sterling Hughes <ster...@php.net> wrote:
>
>> On Mar 22, 2004, at 11:42 AM, Leopold Toetsch wrote:
>
>>> * end is now inserted in @MAIN if missing
>
>> perhaps this should be a compiler warning instead?
>
>If both C<@MAIN> and C<end> are missing, we could compile a module. So
>sometimes you'll get a warning and sometimes not. Not good IMHO.

Yeah. And IMCC's really a low-level thing--if you get the code to it
wrong, then you've got a busted compiler and are likely in lots of
trouble as it is. (Not that it makes *writing* a compiler any easier,
though...)

I think I'd as soon leave out this check by default, and enable it
(and other compiler-writer-friendly operations) with a --picky
option. That way we don't pay the cost normally, but it's there to be
paid if we really need it. (Or enable it with a #define that's
normally not defined, or something)
--
Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk

0 new messages