---------- Forwarded message ----------
From: [EMAIL PROTECTED]
Date: Jun 20, 8:59 pm
Subject: r19207 - in trunk: compilers/imcc config/gen/makefiles tools/
build
To: perl.cvs.parrot


Author: petdance
Date: Wed Jun 20 20:58:59 2007
New Revision: 19207

Modified:
   trunk/compilers/imcc/imcparser.c
   trunk/compilers/imcc/instructions.c
   trunk/compilers/imcc/instructions.h
   trunk/compilers/imcc/parser_util.c
   trunk/compilers/imcc/unit.h
   trunk/config/gen/makefiles/root.in
   trunk/tools/build/headerize.pl

Log:
headerized instructions.c

<snip>
Modified: trunk/compilers/imcc/instructions.c
==============================================================================
--- trunk/compilers/imcc/instructions.c (original)
+++ trunk/compilers/imcc/instructions.c Wed Jun 20 20:58:59 2007
@@ -29,10 +29,13 @@
 int n_comp_units;
 #endif

+/* HEADERIZER TARGET: compilers/imcc/instructions.h */

+/* HEADERIZER BEGIN: static */
 static int e_file_open(Interp *, void *);
 static int e_file_close(Interp *, void *);
 static int e_file_emit(Interp *, void *param, IMC_Unit *, Instruction
*);
+/* HEADERIZER END: static */

 Emitter emitters[2] = {
     {e_file_open,
@@ -121,7 +124,7 @@
  * Returns TRUE if instruction ins reads from a register of type t
  */
 int
-ins_reads2(Instruction *ins, int t)
+ins_reads2(Instruction *ins /*NN*/, int t)
 {
     size_t i, idx;
     const char types[] = "INPS";
@@ -167,19 +170,15 @@
 /* next 2 functions are called very often, says gprof
  * they should be fast
  */
-#ifdef HAS_INLINE
-inline
-#endif
-int
-instruction_reads(Instruction* ins, SymReg* r) {
+inline int
+instruction_reads(Instruction *ins /*NN*/, SymReg *r) {
     int f, i;
     SymReg *key;
-    SymReg *ri;

     if (ins->opnum == PARROT_OP_set_args_pc ||
             ins->opnum == PARROT_OP_set_returns_pc) {
         for (i = 0; i < ins->n_r; i++) {
-            ri = ins->r[i];
+            const SymReg * const ri = ins->r[i];
             if (ri == r)
                 return 1;
         }
@@ -192,7 +191,7 @@
     f = ins->flags;
     for (i = 0; i < ins->n_r; i++) {
         if (f & (1<<i)) {
-            ri = ins->r[i];
+            const SymReg * const ri = ins->r[i];
             if (ri == r)
                 return 1;
             /* this additional test for _kc ops seems to slow
@@ -220,10 +219,7 @@
     return 0;
 }

-#ifdef HAS_INLINE
-inline
-#endif
-int
+inline int
 instruction_writes(Instruction* ins, SymReg* r) {
     int f, i;
<snip>

remember the days when we were C89 compliant? i do.
in fact, my compiler still lives in those days.
'inline' is a swear word.

since compilers don't have earmuffs, i had to make some.
how about
  #ifndef HAS_INLINE
  #  define inline
  #endif

i even put it in parrot.h so it'll work everywhere. see r19212.
~jerry

Reply via email to