[svn:parrot] r47670 - branches/dynop_mapping/compilers/imcc
plobsing at svn.parrot.org
plobsing at svn.parrot.org
Thu Jun 17 06:38:24 UTC 2010
Author: plobsing
Date: Thu Jun 17 06:38:23 2010
New Revision: 47670
URL: https://trac.parrot.org/parrot/changeset/47670
Log:
handle const pointer symregs slightly more appropriately
makes COMPILE_IMMEDIATE=0 work
Modified:
branches/dynop_mapping/compilers/imcc/imc.c
branches/dynop_mapping/compilers/imcc/pbc.c
Modified: branches/dynop_mapping/compilers/imcc/imc.c
==============================================================================
--- branches/dynop_mapping/compilers/imcc/imc.c Thu Jun 17 04:41:51 2010 (r47669)
+++ branches/dynop_mapping/compilers/imcc/imc.c Thu Jun 17 06:38:23 2010 (r47670)
@@ -50,7 +50,7 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
-#define COMPILE_IMMEDIATE 1
+#define COMPILE_IMMEDIATE 0
/*
Modified: branches/dynop_mapping/compilers/imcc/pbc.c
==============================================================================
--- branches/dynop_mapping/compilers/imcc/pbc.c Thu Jun 17 04:41:51 2010 (r47669)
+++ branches/dynop_mapping/compilers/imcc/pbc.c Thu Jun 17 06:38:23 2010 (r47670)
@@ -1648,22 +1648,20 @@
for (key_length = 0; reg ; reg = reg->nextkey, key_length++) {
SymReg *r = reg;
- int type;
if (key_length >= MAX_KEY_LEN)
IMCC_fatal(interp, 1, "build_key:"
"Key too long, increase MAX_KEY_LEN.\n");
- /* if key is a register, the original sym is in r->reg */
- type = r->type;
-
- if (r->reg)
- r = r->reg;
-
- switch (type) {
+ switch (r->type) {
case VTIDENTIFIER: /* P[S0] */
case VTPASM: /* P[S0] */
case VTREG: /* P[S0] */
+
+ /* if key is a register, the original sym is in r->reg */
+ if (r->reg)
+ r = r->reg;
+
if (r->set == 'I')
*pc++ = PARROT_ARG_I; /* register type */
else if (r->set == 'S')
@@ -1683,7 +1681,9 @@
" keypart reg %s %c%d\n",
r->name, r->set, (int)r->color);
break;
+
case VT_CONSTP:
+ r = r->reg;
case VTCONST:
case VTCONST|VT_ENCODED:
switch (r->set) {
@@ -1716,7 +1716,7 @@
break;
default:
IMCC_fatal(interp, 1, "build_key: "
- "unknown type 0x%x on %s\n", type, r->name);
+ "unknown type 0x%x on %s\n", r->type, r->name);
}
}
@@ -1974,7 +1974,7 @@
SymReg *key = r;
for (r = r->nextkey; r; r = r->nextkey)
- if (r->type & VTCONST)
+ if (r->type & (VTCONST|VT_CONSTP))
add_1_const(interp, r);
build_key(interp, key);
}
More information about the parrot-commits
mailing list