]> granicus.if.org Git - yasm/commitdiff
Remove some unused variables/functions.
authorPeter Johnson <peter@tortall.net>
Tue, 14 Feb 2006 03:32:52 +0000 (03:32 -0000)
committerPeter Johnson <peter@tortall.net>
Tue, 14 Feb 2006 03:32:52 +0000 (03:32 -0000)
* dwarf2-info.c (dwarf2_info_head_*): Remove.

* dwarf2-line.c (dwarf2_spp_bc_tobytes): Remove unused variable.
* dwarf2-dbgfmt.c (dwarf2_dbgfmt_generate, dwarf2_head_bc_tobytes): Likewise.
* leb128_test.c (run_input_test): Likewise.

svn path=/trunk/yasm/; revision=1387

libyasm/tests/leb128_test.c
modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c
modules/dbgfmts/dwarf2/dwarf2-info.c
modules/dbgfmts/dwarf2/dwarf2-line.c

index 100e4837762baa06829e967768610fca8a1fe63f..b572eff22574cc181935bfebb999b30ac82e5266 100644 (file)
@@ -135,8 +135,7 @@ run_input_test(Test_Entry *test)
     char *valstr = yasm__xstrdup(test->input);
     yasm_intnum *intn = yasm_intnum_create_hex(valstr, 0);
     yasm_intnum *testn;
-    unsigned long size, i;
-    unsigned char out[100];
+    unsigned long size;
 
     yasm_xfree(valstr);
 
index 3cd717eacba21d2e1b62a585a5047b2bcc7cf76f..af39fb606a63150ea679e6ebca96bc15460f47d9 100644 (file)
@@ -155,7 +155,6 @@ static void
 dwarf2_dbgfmt_generate(yasm_dbgfmt *dbgfmt)
 {
     yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = (yasm_dbgfmt_dwarf2 *)dbgfmt;
-    int new;
     size_t num_line_sections;
     /*@null@*/ yasm_section *debug_info, *debug_line, *main_code;
 
@@ -268,7 +267,6 @@ dwarf2_head_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d,
     yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = head->dbgfmt_dwarf2;
     unsigned char *buf = *bufp;
     yasm_intnum *intn, *cval;
-    size_t i, len;
 
     if (dbgfmt_dwarf2->format == DWARF2_FORMAT_64BIT) {
        YASM_WRITE_8(buf, 0xff);
index b961ff68a2e36d5ddbe565c3ce66a4f2f639a38b..a739772f8e29322b8a486ab31b037ad0395b256b 100644 (file)
@@ -185,13 +185,6 @@ typedef enum {
     DW_AT_vtable_elem_location = 0x4d
 } dwarf_attribute;
 
-typedef struct dwarf2_info_head {
-    yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2;
-    yasm_bytecode *info_start_prevbc;
-    yasm_bytecode *info_end_prevbc;
-    /*@owned@*/ yasm_expr *debug_abbrev_expr;  /* points to debug_abbrev */
-} dwarf2_info_head;
-
 typedef struct dwarf2_abbrev_attr {
     STAILQ_ENTRY(dwarf2_abbrev_attr) link;
     dwarf_attribute name;
@@ -207,16 +200,6 @@ typedef struct dwarf2_abbrev {
 
 /* Bytecode callback function prototypes */
 
-static void dwarf2_info_head_bc_destroy(void *contents);
-static void dwarf2_info_head_bc_print(const void *contents, FILE *f,
-                                     int indent_level);
-static yasm_bc_resolve_flags dwarf2_info_head_bc_resolve
-    (yasm_bytecode *bc, int save, yasm_calc_bc_dist_func calc_bc_dist);
-static int dwarf2_info_head_bc_tobytes
-    (yasm_bytecode *bc, unsigned char **bufp, void *d,
-     yasm_output_expr_func output_expr,
-     /*@null@*/ yasm_output_reloc_func output_reloc);
-
 static void dwarf2_abbrev_bc_destroy(void *contents);
 static void dwarf2_abbrev_bc_print(const void *contents, FILE *f,
                                   int indent_level);
@@ -229,14 +212,6 @@ static int dwarf2_abbrev_bc_tobytes
 
 /* Bytecode callback structures */
 
-static const yasm_bytecode_callback dwarf2_info_head_bc_callback = {
-    dwarf2_info_head_bc_destroy,
-    dwarf2_info_head_bc_print,
-    yasm_bc_finalize_common,
-    dwarf2_info_head_bc_resolve,
-    dwarf2_info_head_bc_tobytes
-};
-
 static const yasm_bytecode_callback dwarf2_abbrev_bc_callback = {
     dwarf2_abbrev_bc_destroy,
     dwarf2_abbrev_bc_print,
@@ -386,77 +361,6 @@ yasm_dwarf2__generate_info(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2,
     return debug_info;
 }
 
-static void
-dwarf2_info_head_bc_destroy(void *contents)
-{
-    dwarf2_info_head *ih = (dwarf2_info_head *)contents;
-    yasm_xfree(contents);
-}
-
-static void
-dwarf2_info_head_bc_print(const void *contents, FILE *f, int indent_level)
-{
-    /* TODO */
-}
-
-static yasm_bc_resolve_flags
-dwarf2_info_head_bc_resolve(yasm_bytecode *bc, int save,
-                           yasm_calc_bc_dist_func calc_bc_dist)
-{
-    yasm_internal_error(N_("tried to resolve a dwarf2 info head bytecode"));
-    /*@notreached@*/
-    return YASM_BC_RESOLVE_MIN_LEN;
-}
-
-static int
-dwarf2_info_head_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d,
-                           yasm_output_expr_func output_expr,
-                           yasm_output_reloc_func output_reloc)
-{
-    dwarf2_info_head *ih = (dwarf2_info_head *)bc->contents;
-    yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = ih->dbgfmt_dwarf2;
-    unsigned char *buf = *bufp;
-    yasm_intnum *intn, *cval;
-    size_t i, len;
-
-    if (dbgfmt_dwarf2->format == DWARF2_FORMAT_64BIT) {
-       YASM_WRITE_8(buf, 0xff);
-       YASM_WRITE_8(buf, 0xff);
-       YASM_WRITE_8(buf, 0xff);
-       YASM_WRITE_8(buf, 0xff);
-    }
-
-    /* Total length of info (following this field) */
-    cval = yasm_intnum_create_uint(dbgfmt_dwarf2->sizeof_offset);
-    intn = yasm_common_calc_bc_dist(ih->info_start_prevbc, ih->info_end_prevbc);
-    yasm_intnum_calc(intn, YASM_EXPR_SUB, cval, bc->line);
-    yasm_arch_intnum_tobytes(dbgfmt_dwarf2->arch, intn, buf,
-                            dbgfmt_dwarf2->sizeof_offset,
-                            dbgfmt_dwarf2->sizeof_offset*8, 0, bc, 0, 0);
-    buf += dbgfmt_dwarf2->sizeof_offset;
-    yasm_intnum_destroy(intn);
-
-    /* DWARF version */
-    yasm_intnum_set_uint(cval, 2);
-    yasm_arch_intnum_tobytes(dbgfmt_dwarf2->arch, cval, buf, 2, 16, 0, bc, 0,
-                            0);
-    buf += 2;
-
-    /* Pointer to our debug_abbrev */
-    output_expr(&ih->debug_abbrev_expr, buf, dbgfmt_dwarf2->sizeof_offset,
-               dbgfmt_dwarf2->sizeof_offset*8, 0, (unsigned long)(buf-*bufp),
-               bc, 0, 0, d);
-    buf += dbgfmt_dwarf2->sizeof_offset;
-
-    /* Size of the offset portion of the address */
-    YASM_WRITE_8(buf, dbgfmt_dwarf2->sizeof_address);
-
-    *bufp = buf;
-
-    yasm_intnum_destroy(cval);
-    return 0;
-}
-
 static void
 dwarf2_abbrev_bc_destroy(void *contents)
 {
index a8a11e6da44769ae76d13f58a0899f0aeee3ef97..6f0f801dd3b3a44cedca254925a78457eff184d0 100644 (file)
@@ -708,7 +708,7 @@ dwarf2_spp_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d,
     dwarf2_spp *spp = (dwarf2_spp *)bc->contents;
     yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = spp->dbgfmt_dwarf2;
     unsigned char *buf = *bufp;
-    yasm_intnum *intn, *cval;
+    yasm_intnum *cval;
     size_t i, len;
 
     /* Prologue length (following this field) */