Skip to content

Commit

Permalink
[mono] Remove a few set but unused variables (#66839)
Browse files Browse the repository at this point in the history
These triggered a warning in the new clang included with Xcode 13.3
  • Loading branch information
akoeplinger authored Mar 18, 2022
1 parent 26554c4 commit 798d52b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 41 deletions.
3 changes: 0 additions & 3 deletions src/mono/mono/metadata/sgen-new-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,10 @@ free_data (void)
{
MonoObject *obj G_GNUC_UNUSED;
HashEntry *entry;
int total_srcs = 0;
int max_srcs = 0;

SGEN_HASH_TABLE_FOREACH (&hash_table, MonoObject *, obj, HashEntry *, entry) {
int entry_size = dyn_array_ptr_size (&entry->srcs);
total_srcs += entry_size;
if (entry_size > max_srcs)
max_srcs = entry_size;
dyn_array_ptr_uninit (&entry->srcs);
Expand All @@ -255,7 +253,6 @@ free_data (void)
sgen_hash_table_clean (&hash_table);

dyn_array_int_uninit (&merge_array);
//g_print ("total srcs %d - max %d\n", total_srcs, max_srcs);
}

static HashEntry*
Expand Down
3 changes: 0 additions & 3 deletions src/mono/mono/metadata/sgen-old-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,10 @@ free_data (void)
{
GCObject *obj G_GNUC_UNUSED;
HashEntry *entry;
int total_srcs = 0;
int max_srcs = 0;

SGEN_HASH_TABLE_FOREACH (&hash_table, GCObject *, obj, HashEntry *, entry) {
int entry_size = dyn_array_ptr_size (&entry->srcs);
total_srcs += entry_size;
if (entry_size > max_srcs)
max_srcs = entry_size;
dyn_array_ptr_uninit (&entry->srcs);
Expand All @@ -439,7 +437,6 @@ free_data (void)
sgen_hash_table_clean (&hash_table);

dyn_array_int_uninit (&merge_array);
//g_print ("total srcs %d - max %d\n", total_srcs, max_srcs);
}

static HashEntry*
Expand Down
4 changes: 0 additions & 4 deletions src/mono/mono/mini/aot-compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -3352,15 +3352,11 @@ encode_klass_ref_inner (MonoAotCompile *acfg, MonoClass *klass, guint8 *buf, gui
} else {
MonoClass *gclass = mono_class_get_generic_class (klass)->container_class;
MonoGenericInst *inst = mono_class_get_generic_class (klass)->context.class_inst;
static int count = 0;
guint8 *p1 = p;

encode_value (MONO_AOT_TYPEREF_GINST, p, &p);
encode_klass_ref (acfg, gclass, p, &p);
guint32 offset = get_shared_ginst_ref (acfg, inst);
encode_value (offset, p, &p);

count += p - p1;
}
} else if (m_class_get_type_token (klass)) {
int iindex = get_image_index (acfg, m_class_get_image (klass));
Expand Down
9 changes: 5 additions & 4 deletions src/mono/mono/mini/image-writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ asm_writer_emit_symbol_type (MonoImageWriter *acfg, const char *name, gboolean f
static void
asm_writer_emit_symbol_type (MonoImageWriter *acfg, const char *name, gboolean func, gboolean global)
{
#if defined(TARGET_ASM_APPLE)
asm_writer_emit_unset_mode (acfg);
#else
const char *stype;

if (func)
Expand All @@ -253,14 +256,12 @@ asm_writer_emit_symbol_type (MonoImageWriter *acfg, const char *name, gboolean f
stype = "object";

asm_writer_emit_unset_mode (acfg);

#if defined(TARGET_ASM_APPLE)

#elif defined(TARGET_ARM)
#if defined(TARGET_ARM)
fprintf (acfg->fp, "\t.type %s,#%s\n", name, stype);
#else
fprintf (acfg->fp, "\t.type %s,@%s\n", name, stype);
#endif
#endif
}
#endif /* TARGET_WIN32 */

Expand Down
10 changes: 1 addition & 9 deletions src/mono/mono/mini/mini-amd64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ mono_arch_compute_omit_fp (MonoCompile *cfg)
{
MonoMethodSignature *sig;
MonoMethodHeader *header;
int i, locals_size;
int i;
CallInfo *cinfo;

if (cfg->arch.omit_fp_computed)
Expand Down Expand Up @@ -1586,14 +1586,6 @@ mono_arch_compute_omit_fp (MonoCompile *cfg)
cfg->arch.omit_fp = FALSE;
}
}

locals_size = 0;
for (i = cfg->locals_start; i < cfg->num_varinfo; i++) {
MonoInst *ins = cfg->varinfo [i];
int ialign;

locals_size += mono_type_size (ins->inst_vtype, &ialign);
}
}

GList *
Expand Down
10 changes: 1 addition & 9 deletions src/mono/mono/mini/mini-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1846,7 +1846,7 @@ mono_arch_compute_omit_fp (MonoCompile *cfg)
{
MonoMethodSignature *sig;
MonoMethodHeader *header;
int i, locals_size;
int i;
CallInfo *cinfo;

if (cfg->arch.omit_fp_computed)
Expand Down Expand Up @@ -1895,14 +1895,6 @@ mono_arch_compute_omit_fp (MonoCompile *cfg)
cfg->arch.omit_fp = FALSE;
}
}

locals_size = 0;
for (i = cfg->locals_start; i < cfg->num_varinfo; i++) {
MonoInst *ins = cfg->varinfo [i];
int ialign;

locals_size += mono_type_size (ins->inst_vtype, &ialign);
}
}

/*
Expand Down
10 changes: 1 addition & 9 deletions src/mono/mono/mini/mini-mips.c
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ mono_arch_compute_omit_fp (MonoCompile *cfg)
{
MonoMethodSignature *sig;
MonoMethodHeader *header;
int i, locals_size;
int i;
CallInfo *cinfo;

if (cfg->arch.omit_fp_computed)
Expand Down Expand Up @@ -1350,14 +1350,6 @@ mono_arch_compute_omit_fp (MonoCompile *cfg)
cfg->arch.omit_fp = FALSE;
*/

locals_size = 0;
for (i = cfg->locals_start; i < cfg->num_varinfo; i++) {
MonoInst *ins = cfg->varinfo [i];
int ialign;

locals_size += mono_type_size (ins->inst_vtype, &ialign);
}

//printf ("D: %s %d\n", cfg->method->name, cfg->arch.omit_fp);
}

Expand Down

0 comments on commit 798d52b

Please sign in to comment.