cvsuser 03/01/13 09:46:47
Modified: config/gen/makefiles imcc.in
languages/imcc/docs running.pod
languages/imcc main.c optimizer.c
Log:
run pbc files too
Revision Changes Path
1.9 +3 -1 parrot/config/gen/makefiles/imcc.in
Index: imcc.in
===================================================================
RCS file: /cvs/public/parrot/config/gen/makefiles/imcc.in,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -r1.8 -r1.9
--- imcc.in 22 Dec 2002 17:19:07 -0000 1.8
+++ imcc.in 13 Jan 2003 17:46:44 -0000 1.9
@@ -23,7 +23,9 @@
#DO NOT ADD C COMPILER FLAGS HERE
#Add them in Configure.pl--look for the
#comment 'ADD C COMPILER FLAGS HERE'
-CFLAGS = ${ccflags} ${cc_warn} -I../../include
+CFLAGS = ${ccflags} -I../../include
+# turn off warnings until fixed
+# CFLAGS = ${ccflags} ${cc_warn} -I../../include
C_LIBS = ${libs}
1.3 +2 -1 parrot/languages/imcc/docs/running.pod
Index: running.pod
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/docs/running.pod,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- running.pod 22 Dec 2002 17:13:02 -0000 1.2
+++ running.pod 13 Jan 2003 17:46:46 -0000 1.3
@@ -62,6 +62,7 @@
=head1 <file>
+If the file ends in B<.pbc> it will be interpreted.
If the file ends in B<.pasm> it is parsed as PASM code else as PIR
code.
@@ -78,7 +79,7 @@
=head1 BUGS
-The long options are unimplemented.
+The long imcc options are unimplemented.
=head1 FILES
1.4 +110 -88 parrot/languages/imcc/main.c
Index: main.c
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/main.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -r1.3 -r1.4
--- main.c 11 Dec 2002 14:50:50 -0000 1.3
+++ main.c 13 Jan 2003 17:46:47 -0000 1.4
@@ -132,11 +132,21 @@
optimizer_opt[sizeof(optimizer_opt)-1] = '\0';
break;
case '-':
- /* XXX long options */
+ if ((*argv)[0][2] == '\0') {
(*argc)--;
(*argv)++;
-
goto DONE;
+ } else if (strncmp((*argv)[0], "--gc-debug", 10) == 0) {
+#if DISABLE_GC_DEBUG
+ Parrot_warn(interpreter, PARROT_WARNINGS_ALL_FLAG,
+ "PARROT_GC_DEBUG is set but the binary was "
+ "compiled with DISABLE_GC_DEBUG.");
+#endif
+ setopt(PARROT_GC_DEBUG_FLAG);
+ break;
+ }
+
+ /* XXX long options */
case '\0': /* bare '-' means read from stdin */
goto DONE;
default:
@@ -185,6 +195,12 @@
ext = strrchr(sourcefile, '.');
if (ext && strcmp (ext, ".pasm") == 0) {
pasm_file = 1;
+ if (output)
+ write_pbc = 1;
+ }
+ else if (ext && strcmp (ext, ".pbc") == 0) {
+ pbc = 2;
+ write_pbc = 0;
}
}
@@ -200,6 +216,11 @@
else
info(1,"\n");
}
+ if (pbc == 2) {
+ pf = Parrot_readbc(interpreter, sourcefile);
+ Parrot_loadbc(interpreter, pf);
+ }
+ else {
info(1, "using optimization '%s'\n", optimizer_opt);
line = 1;
@@ -212,6 +233,7 @@
fclose(yyin);
info(1, "%ld lines compiled.\n", line);
+ }
if (write_pbc) {
size_t size;
opcode_t *packed;
@@ -234,7 +256,7 @@
info(1, "%s written.\n", output);
free(packed);
}
- if (pbc == 1) {
+ if (pbc) {
if (!gc_off)
interpreter->DOD_block_level--;
info(1, "Running...\n");
1.7 +2 -2 parrot/languages/imcc/optimizer.c
Index: optimizer.c
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/optimizer.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -r1.6 -r1.7
--- optimizer.c 24 Dec 2002 12:12:15 -0000 1.6
+++ optimizer.c 13 Jan 2003 17:46:47 -0000 1.7
@@ -80,7 +80,7 @@
}
/* get negated opterator for op */
-static char * get_neg_op(char *op, int *nargs)
+static const char * get_neg_op(char *op, int *nargs)
{
static struct br_pairs {
const char *op;
@@ -127,7 +127,7 @@
if (ins->next &&
(ins->next->type & ITLABEL) && /* Lx */
ins->next->r[0] == br_dest) {
- char * neg_op;
+ const char * neg_op;
SymReg * go = get_branch_reg(ins);
int args;