Will Coleda via RT <[EMAIL PROTECTED]> 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