develooper Front page | perl.perl6.internals | Postings from September 2005

Re: [perl #25255] IMCC - no warning on duplicate .local vars

From:
Will Coleda
Date:
September 22, 2005 06:33
Subject:
Re: [perl #25255] IMCC - no warning on duplicate .local vars
Message ID:
2DCEA94F-3DA7-485C-89C0-71243D74F1A2@coleda.com
As many TODOs, I'd say, one per bullet.

Thanks!

On Sep 22, 2005, at 3:31 AM, Joshua Hoblitt via RT wrote:


>> [leo - Mon Nov 01 06:28:21 2004]:
>>
>> Will Coleda via RT <parrotbug-followup@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
>>
>>
>>
>>
>>
>
> Leo,
>
> Should this be distilled into a TODO?
>
> -J
>
>
>





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About