cvsuser     03/11/12 23:03:23

  Modified:    imcc     imc.h symreg.h unit.h
  Log:
  Fix most of IMCC breakage introduced by last major patch.
  Localize more structures (register list and local symbol hash)
  and modify APIs. No more global "hash" or "reglist" variables.
  Add lots of debugging conditionals.
  
  Revision  Changes    Path
  1.55      +10 -2     parrot/imcc/imc.h
  
  Index: imc.h
  ===================================================================
  RCS file: /cvs/public/parrot/imcc/imc.h,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -w -r1.54 -r1.55
  --- imc.h     4 Nov 2003 07:46:18 -0000       1.54
  +++ imc.h     13 Nov 2003 07:03:23 -0000      1.55
  @@ -56,7 +56,9 @@
    */
   void imc_compile_all_units(struct Parrot_Interp *);
   void imc_compile_unit(struct Parrot_Interp *, IMC_Unit * unit);
  -IMC_Unit * imc_cur_unit(struct Parrot_Interp *);
  +void imc_close_unit(struct Parrot_Interp *, IMC_Unit *);
  +void imc_free_unit(struct Parrot_Interp *, IMC_Unit *);
  +void imc_cleanup(struct Parrot_Interp *);
   
   /*
    * instructions.c
  @@ -134,7 +136,7 @@
   typedef struct _imc_info_t {
   
       IMC_Unit * imc_units;
  -    IMC_Unit * cur_unit;
  +    IMC_Unit * last_unit;
       int imcc_warn;
       int verbose;
       int debug;
  @@ -143,6 +145,12 @@
   } imc_info_t;
   
   #define IMCC_INFO(i) ((i)->imc_info)
  +
  +#define IMC_TRACE 0
  +
  +
  +extern IMC_Unit * cur_unit;
  +
   #endif
   
   
  
  
  
  1.35      +8 -3      parrot/imcc/symreg.h
  
  Index: symreg.h
  ===================================================================
  RCS file: /cvs/public/parrot/imcc/symreg.h,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -w -r1.34 -r1.35
  --- symreg.h  4 Nov 2003 07:47:28 -0000       1.34
  +++ symreg.h  13 Nov 2003 07:03:23 -0000      1.35
  @@ -138,9 +138,11 @@
   void _store_symreg(SymReg *hash[], SymReg * r);
   SymReg * _mk_address(SymReg *hash[], char * name, int uniq);
   SymReg * link_keys(int nargs, SymReg *keys[]);
  -void clear_tables(struct _IMC_Unit *, SymReg *h[]);
  +void clear_locals(struct _IMC_Unit *);
  +void clear_sym_hash(SymReg **);
  +void clear_globals(void);
   unsigned int  hash_str(const char * str);
  -void _delete_sym(struct _IMC_Unit *, SymReg * hsh[], const char * name);
  +void _delete_sym(struct _IMC_Unit *, const char * name);
   
   SymReg * _find_sym(Namespace * ns, SymReg * hash[], const char * name);
   char * _mk_fullname(Namespace * ns, const char * name);
  @@ -150,7 +152,10 @@
   
   /* globals */
   
  -EXTERN SymReg * hash[HASH_SIZE], *ghash[HASH_SIZE];
  +/* Now local to each unit
  +  EXTERN SymReg * hash[HASH_SIZE];
  +*/
  +EXTERN SymReg * ghash[HASH_SIZE];
   
   #endif
   
  
  
  
  1.4       +2 -0      parrot/imcc/unit.h
  
  Index: unit.h
  ===================================================================
  RCS file: /cvs/public/parrot/imcc/unit.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -r1.3 -r1.4
  --- unit.h    4 Nov 2003 07:47:28 -0000       1.3
  +++ unit.h    13 Nov 2003 07:03:23 -0000      1.4
  @@ -20,6 +20,7 @@
       IMC_Unit_Type type;
       Instruction * instructions;
       Instruction * last_ins;
  +    SymReg ** hash;
       Symbol * sym;
       int bb_list_size;
       int n_basic_blocks;
  @@ -42,6 +43,7 @@
   IMC_Unit * imc_open_unit(Parrot_Interp, IMC_Unit_Type);
   void imc_close_unit(Parrot_Interp, IMC_Unit *);
   IMC_Unit * imc_new_unit(IMC_Unit_Type);
  +void imc_free_unit(Parrot_Interp, IMC_Unit *);
   IMC_Unit * imc_order_for_emit(IMC_Unit * list);
   
   #endif
  
  
  

Reply via email to