[svn:parrot] r49258 - in trunk: compilers/imcc include/parrot

plobsing at svn.parrot.org plobsing at svn.parrot.org
Thu Sep 23 04:32:35 UTC 2010


Author: plobsing
Date: Thu Sep 23 04:32:34 2010
New Revision: 49258
URL: https://trac.parrot.org/parrot/changeset/49258

Log:
remove dead code - PackFile_Constant and add_const_key

Modified:
   trunk/compilers/imcc/pbc.c
   trunk/include/parrot/packfile.h

Modified: trunk/compilers/imcc/pbc.c
==============================================================================
--- trunk/compilers/imcc/pbc.c	Thu Sep 23 04:05:43 2010	(r49257)
+++ trunk/compilers/imcc/pbc.c	Thu Sep 23 04:32:34 2010	(r49258)
@@ -58,12 +58,6 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*r);
 
-static int add_const_key(PARROT_INTERP,
-    const opcode_t *key,
-    int size,
-    const char *s_key)
-        __attribute__nonnull__(1);
-
 PARROT_WARN_UNUSED_RESULT
 static int add_const_num(PARROT_INTERP, ARGIN_NULLOK(const char *buf))
         __attribute__nonnull__(1);
@@ -1584,58 +1578,6 @@
 
 /*
 
-=item C<static int add_const_key(PARROT_INTERP, const opcode_t *key, int size,
-const char *s_key)>
-
-Adds a constant key to constant_table.
-
-=cut
-
-*/
-
-static int
-add_const_key(PARROT_INTERP, const opcode_t *key, int size, const char *s_key)
-{
-    ASSERT_ARGS(add_const_key)
-    const SymReg * const r =
-        _get_sym(&IMCC_INFO(interp)->globals->cs->key_consts, s_key);
-    const opcode_t      *rc;
-    PackFile_Constant   *pfc;
-    int                  k;
-
-    if (r)
-        return r->color;
-
-#if 0
-    pfc = mem_gc_allocate_typed(interp, PackFile_Constant);
-    rc  = PackFile_Constant_unpack_key(interp,
-            interp->code->const_table, pfc, key);
-#endif
-
-    if (!rc) {
-        mem_sys_free(pfc);
-        IMCC_fatal(interp, 1,
-            "add_const_key: PackFile_Constant error\n");
-    }
-
-    k = add_const_table_pmc(interp, pfc->u.key);
-
-    store_key_const(interp, s_key, k);
-
-    IMCC_debug(interp, DEBUG_PBC_CONST, "\t=> %s #%d size %d\n",
-               s_key, k, size);
-
-    IMCC_debug(interp, DEBUG_PBC_CONST, "\t %x /%x %x/ /%x %x/\n",
-               key[0], key[1], key[2], key[3], key[4]);
-
-    mem_sys_free(pfc);
-
-    return k;
-}
-
-
-/*
-
 =item C<static opcode_t build_key(PARROT_INTERP, SymReg *key_reg)>
 
 Builds a Key PMC from the given SymReg.

Modified: trunk/include/parrot/packfile.h
==============================================================================
--- trunk/include/parrot/packfile.h	Thu Sep 23 04:05:43 2010	(r49257)
+++ trunk/include/parrot/packfile.h	Thu Sep 23 04:32:34 2010	(r49258)
@@ -164,15 +164,6 @@
     opcode_t dir_format;
 } PackFile_Header;
 
-typedef struct PackFile_Constant {
-    opcode_t type;
-    union {
-        FLOATVAL  number;
-        STRING   *string;
-        PMC      *key;
-    } u;
-} PackFile_Constant;
-
 /*
 ** PackFile Segment:
 *    The base type of every section


More information about the parrot-commits mailing list