[svn:parrot] r39786 - in branches/pmc_pct/compilers/pmcc/src: emitter parser
cotto at svn.parrot.org
cotto at svn.parrot.org
Fri Jun 26 00:09:46 UTC 2009
Author: cotto
Date: Fri Jun 26 00:09:45 2009
New Revision: 39786
URL: https://trac.parrot.org/parrot/changeset/39786
Log:
[pmcc] Stow the vtable dump in the past during parsing. This isn't ideal, but the info is needed to detect some kinds of errors during past construction.
Modified:
branches/pmc_pct/compilers/pmcc/src/emitter/pmc.pm
branches/pmc_pct/compilers/pmcc/src/parser/actions.pm
Modified: branches/pmc_pct/compilers/pmcc/src/emitter/pmc.pm
==============================================================================
--- branches/pmc_pct/compilers/pmcc/src/emitter/pmc.pm Thu Jun 25 23:47:17 2009 (r39785)
+++ branches/pmc_pct/compilers/pmcc/src/emitter/pmc.pm Fri Jun 26 00:09:45 2009 (r39786)
@@ -312,7 +312,7 @@
method generate_c_code($past) {
- my %vtables := thaw('../../vtable.frozen');
+ my %vtables := self.past.vtdump;
#make sure there aren't any misnamed VTABLE functions
for self.past.vtables{'default'} {
if !%vtables{$_} {
Modified: branches/pmc_pct/compilers/pmcc/src/parser/actions.pm
==============================================================================
--- branches/pmc_pct/compilers/pmcc/src/parser/actions.pm Thu Jun 25 23:47:17 2009 (r39785)
+++ branches/pmc_pct/compilers/pmcc/src/parser/actions.pm Fri Jun 26 00:09:45 2009 (r39786)
@@ -24,6 +24,7 @@
# Save c_header.
$?PMC<c_header> := substr($/.orig, 0, $/.from);
+ $?PMC<vtdump> := thaw('../../vtable.frozen');
}
else {
# TODO Set c_header and c_coda
@@ -190,6 +191,12 @@
);
$past<parameters> := $<c_signature><c_arguments>.ast;
+ my %attrs;
+ for $<method_attr> {
+ %attrs{~$_<identifier>} := 1;
+ }
+ $past<attrs> := %attrs;
+
# Handle parameters to create short and long signaures
# Largely stolen from Pmc2c::MULTIs::rewrite_multi_sub
@@ -225,12 +232,6 @@
$past<long_signature> := join(',', @long_sig);
$past<full_name> := "multi_" ~ $past.name ~ "_" ~ join('_', @long_sig);
- my %attrs;
- for $<method_attr> {
- %attrs{~$_<identifier>} := 1;
- }
- $past<attrs> := %attrs;
-
make $past;
}
More information about the parrot-commits
mailing list