Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
IMCC - no warning on duplicate .local vars
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Will Coleda via RT  
View profile  
 More options Oct 30 2004, 12:59 am
Newsgroups: perl.perl6.internals
From: parrotbug-follo...@parrotcode.org (Will Coleda via RT)
Date: 30 Oct 2004 04:59:35 -0000
Local: Sat, Oct 30 2004 12:59 am
Subject: [perl #25255] IMCC - no warning on duplicate .local vars

> [coke - Sat Jan 24 19:32:16 2004]:

> It would be helpful if IMCC complained about duplicate ".local" labels,
> so that the attached wouldn't compile, rather than dying at runtime.

A naive pass at this is:

oolong:~/research/parrot coke$ cvs diff imcc/symreg.c
Index: imcc/symreg.c
=========================================================
==========
RCS file: /cvs/public/parrot/imcc/symreg.c,v
retrieving revision 1.55
diff -b -u -r1.55 symreg.c
--- imcc/symreg.c       17 Jul 2004 08:07:27 -0000      1.55
+++ imcc/symreg.c       30 Oct 2004 04:45:21 -0000
@@ -287,6 +287,11 @@
         ident->next = namespace->idents;
         namespace->idents = ident;
     }
+    if (_get_sym(cur_unit->hash,fullname)) {
+        fataly(1, sourcefile, line,
+            "duplicate .local or .sym: '%s'",
+                     fullname);
+    }
     r = mk_symreg(fullname, t);
     r->type = VTIDENTIFIER;
     free(name);

This causes a few tests to fail:

t/library/dumper.t      13  3328    13   13 100.00%  1-13
t/library/parrotlib.t    1   256     6    1  16.67%  3
t/library/streams.t     12  3072    21   12  57.14%  2 4-5 8 10-12 14-17 20
t/pmc/iter.t             1   256    44    1   2.27%  11

/Some/ of these seem to be valid errors. But it also seems to not like having .subs with the
same name as a .local inside that sub.

Also, the errors message isn't reporting properly.

Help?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
William Coleda  
View profile  
 More options Oct 30 2004, 1:02 am
Newsgroups: perl.perl6.internals
From: w...@coleda.com (William Coleda)
Date: Sat, 30 Oct 2004 01:02:48 -0400
Local: Sat, Oct 30 2004 1:02 am
Subject: Re: [perl #25255] IMCC - no warning on duplicate .local vars
That is to say, the file and line number appear to be off.

Will Coleda via RT wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options Nov 1 2004, 8:02 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Mon, 1 Nov 2004 14:02:00 +0100
Subject: Re: [perl #25255] IMCC - no warning on duplicate .local vars
Will Coleda via RT <parrotbug-follo...@parrotcode.org> wrote:

>> [coke - Sat Jan 24 19:32:16 2004]:

>> It would be helpful if IMCC complained about duplicate ".local" labels,
>> so that the attached wouldn't compile, rather than dying at runtime.

> A naive pass at this is:
> +    if (_get_sym(cur_unit->hash,fullname)) {
> +        fataly(1, sourcefile, line,

While this patch isn't really wrong it's probably a bit dangerous and
might break too much existing code.

Anyway I'd prefer a more general approach:

* split PASM and PIR lexer and parser into two distinct sets
  (the -p prefix option for bison is helpful here, see ast/ast.[ly])

* generate exact location information, again see above files

* Cleanup and straighten the grammar files

* fix names handling: global constants, locals per unit, subroutine
  names per namespace

* get rid of support for stack calling conventions (.param and friends)
  in PIR mode

* get rid of related cruft in imcc/cfg.c

* get rid of the still existing globals, move all into appropriate
  structures, mostly IMC_Unit.

* and a lot more todo, e.g. create a compiler API

Imcc has too much historical ballast. Since it was a standalone language
that produced PASM files it has gone through numerous changes and hacks.
Now it's since quite a time Parrot's compiler and integrated.

These changes shouldn't really interfer with current ongoing hacks in
reg_alloc.c as long as that file isn't touched and the SymReg structure
keeps the relevant information for register allocation.

leo


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google