This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
gas patch: remove redundant returns
- From: Ben Elliston <bje at wasabisystems dot com>
- To: binutils at sources dot redhat dot com
- Date: 10 Dec 2003 15:33:41 +1100
- Subject: gas patch: remove redundant returns
I discovered some void functions in gas that explicity return. I used
grep -A 1 '^ return; *$' to find all effected files in gas/config and
have generated the following rather large patch which removes them
all. I don't think this is worthy of a ChangeLog entry.
Okay to commit?
Index: obj-vms.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-vms.c,v
retrieving revision 1.14
diff -u -p -r1.14 obj-vms.c
--- obj-vms.c 22 Nov 2003 15:32:28 -0000 1.14
+++ obj-vms.c 10 Dec 2003 04:29:52 -0000
@@ -414,13 +414,11 @@ vms_check_for_special_label (symbolS *sy
flag_hash_long_names = 1;
#endif
}
- return;
}
void
obj_read_begin_hook (void)
{
- return;
}
void
@@ -1744,7 +1742,6 @@ setup_basic_type (struct VMS_DBG_Symbol
VMS_Store_Immediate_Data (Local, Lpnt, OBJ_S_C_DBG);
Lpnt = 0;
#endif /* SETUP_BASIC_TYPES */
- return;
}
/* This routine generates a symbol definition for a C symbol for the
@@ -1976,7 +1973,6 @@ VMS_stab_parse (symbolS *sp, int expecte
/* ...and restore the string. */
*pnt1 = ':';
- return;
}
/* Simpler interfaces into VMS_stab_parse(). */
@@ -4155,8 +4151,6 @@ synthesize_data_segment (unsigned data_s
}
}
}
-
- return;
}
/* Perform data segment fixups. */
@@ -4281,8 +4275,6 @@ vms_fixup_xtors_section (struct VMS_Symb
/* Flush the buffer if it is more than 75% full. */
if (Object_Record_Offset > (sizeof (Object_Record_Buffer) * 3 / 4))
Flush_VMS_Object_Record_Buffer ();
-
- return;
}
@@ -4540,8 +4532,6 @@ global_symbol_directory (unsigned text_s
0,
GBLSYM_DEF);
}
-
- return;
}
Index: tc-alpha.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-alpha.c,v
retrieving revision 1.60
diff -u -p -r1.60 tc-alpha.c
--- tc-alpha.c 4 Dec 2003 00:54:16 -0000 1.60
+++ tc-alpha.c 10 Dec 2003 04:29:58 -0000
@@ -4943,7 +4943,6 @@ s_alpha_ent (ignore)
alpha_evax_proc.symbol = symbol;
demand_empty_rest_of_line ();
- return;
}
/* Parse .frame <framreg>,<framesize>,RA,<rsa_offset> directives. */
@@ -4978,8 +4977,6 @@ s_alpha_frame (ignore)
return;
}
alpha_evax_proc.rsa_offset = get_absolute_expression ();
-
- return;
}
static void
@@ -5129,8 +5126,6 @@ s_alpha_pdesc (ignore)
md_number_to_chars (p, alpha_evax_proc.imask, 4);
md_number_to_chars (p + 4, alpha_evax_proc.fmask, 4);
-
- return;
}
/* Support for crash debug on vms. */
@@ -5169,8 +5164,6 @@ s_alpha_name (ignore)
seginfo->literal_pool_size += 8;
fix_new_exp (frag_now, p - frag_now->fr_literal, 8, &exp, 0, BFD_RELOC_64);
-
- return;
}
static void
@@ -5197,8 +5190,6 @@ s_alpha_linkage (ignore)
BFD_RELOC_ALPHA_LINKAGE);
}
demand_empty_rest_of_line ();
-
- return;
}
static void
@@ -5225,8 +5216,6 @@ s_alpha_code_address (ignore)
BFD_RELOC_ALPHA_CODEADDR);
}
demand_empty_rest_of_line ();
-
- return;
}
static void
@@ -5237,7 +5226,6 @@ s_alpha_fp_save (ignore)
alpha_evax_proc.fp_save = tc_get_register (1);
demand_empty_rest_of_line ();
- return;
}
static void
@@ -5257,8 +5245,6 @@ s_alpha_mask (ignore)
(void) get_absolute_expression ();
}
demand_empty_rest_of_line ();
-
- return;
}
static void
@@ -5278,8 +5264,6 @@ s_alpha_fmask (ignore)
(void) get_absolute_expression ();
}
demand_empty_rest_of_line ();
-
- return;
}
static void
@@ -5292,8 +5276,6 @@ s_alpha_end (ignore)
*input_line_pointer = c;
demand_empty_rest_of_line ();
alpha_evax_proc.symbol = 0;
-
- return;
}
static void
@@ -5314,8 +5296,6 @@ s_alpha_file (ignore)
s = symbol_find_or_make (demand_copy_string (&length));
symbol_get_bfdsym (s)->flags |= BSF_FILE;
demand_empty_rest_of_line ();
-
- return;
}
#endif /* OBJ_EVAX */
@@ -5675,7 +5655,6 @@ alpha_print_token (f, exp)
print_expr (f, exp);
break;
}
- return;
}
#endif
Index: tc-arc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arc.c,v
retrieving revision 1.24
diff -u -p -r1.24 tc-arc.c
--- tc-arc.c 21 Nov 2003 00:24:40 -0000 1.24
+++ tc-arc.c 10 Dec 2003 04:30:00 -0000
@@ -1475,7 +1475,6 @@ arc_common (localScope)
symbolP->bsym->flags |= BSF_OBJECT;
demand_empty_rest_of_line ();
- return;
}
/* Select the cpu we're assembling for. */
Index: tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.153
diff -u -p -r1.153 tc-arm.c
--- tc-arm.c 9 Dec 2003 17:41:12 -0000 1.153
+++ tc-arm.c 10 Dec 2003 04:30:16 -0000
@@ -4031,7 +4030,6 @@ do_empty (str)
{
/* Do nothing really. */
end_of_line (str);
- return;
}
static void
@@ -4215,7 +4213,6 @@ do_mull (str)
}
end_of_line (str);
- return;
}
static void
@@ -4269,7 +4266,6 @@ do_mul (str)
}
end_of_line (str);
- return;
}
static void
@@ -4325,7 +4321,6 @@ do_mla (str)
}
end_of_line (str);
- return;
}
/* Expects *str -> the characters "acc0", possibly with leading blanks.
@@ -5760,7 +5755,6 @@ do_cps_mode (str)
}
inst.instruction |= expr.X_add_number;
- return;
}
static void
@@ -6292,7 +6286,6 @@ do_iwmmxt_tandc (str)
if (reg != REG_PC && !inst.error)
inst.error = _("only r15 allowed here");
- return;
}
static void
@@ -6300,8 +6293,6 @@ do_iwmmxt_tbcst (str)
char * str;
{
check_iwmmxt_insn (str, check_tbcst, 0);
-
- return;
}
static void
@@ -6314,7 +6305,6 @@ do_iwmmxt_textrc (str)
return;
inst.instruction |= number & 0x7;
- return;
}
static void
@@ -6339,7 +6329,6 @@ do_iwmmxt_tinsr (str)
return;
inst.instruction |= number & 0x7;
- return;
}
static void
@@ -6347,8 +6336,6 @@ do_iwmmxt_tmcr (str)
char * str;
{
check_iwmmxt_insn (str, check_tmcr, 0);
-
- return;
}
static void
@@ -6356,8 +6343,6 @@ do_iwmmxt_tmcrr (str)
char * str;
{
check_iwmmxt_insn (str, check_tmcrr, 0);
-
- return;
}
static void
@@ -6365,8 +6350,6 @@ do_iwmmxt_tmia (str)
char * str;
{
check_iwmmxt_insn (str, check_tmia, 0);
-
- return;
}
static void
@@ -6374,8 +6357,6 @@ do_iwmmxt_tmovmsk (str)
char * str;
{
check_iwmmxt_insn (str, check_tmovmsk, 0);
-
- return;
}
static void
@@ -6383,8 +6364,6 @@ do_iwmmxt_tmrc (str)
char * str;
{
check_iwmmxt_insn (str, check_tmrc, 0);
-
- return;
}
static void
@@ -6392,8 +6371,6 @@ do_iwmmxt_tmrrc (str)
char * str;
{
check_iwmmxt_insn (str, check_tmrrc, 0);
-
- return;
}
static void
@@ -6401,7 +6378,6 @@ do_iwmmxt_torc (str)
char * str;
{
check_iwmmxt_insn (str, check_rd, 0);
- return;
}
static void
@@ -6414,7 +6390,6 @@ do_iwmmxt_waligni (str)
return;
inst.instruction |= ((number & 0x7) << 20);
- return;
}
static void
@@ -6425,7 +6400,6 @@ do_iwmmxt_wmov (str)
return;
inst.instruction |= ((inst.instruction >> 16) & 0xf);
- return;
}
static void
@@ -6466,8 +6440,6 @@ do_iwmmxt_wrwr (str)
char * str;
{
check_iwmmxt_insn (str, check_wrwr, 0);
-
- return;
}
static void
@@ -6475,8 +6447,6 @@ do_iwmmxt_wrwrwcg (str)
char * str;
{
check_iwmmxt_insn (str, check_wrwrwcg, 0);
-
- return;
}
static void
@@ -6484,8 +6454,6 @@ do_iwmmxt_wrwrwr (str)
char * str;
{
check_iwmmxt_insn (str, check_wrwrwr, 0);
-
- return;
}
static void
@@ -6498,7 +6466,6 @@ do_iwmmxt_wshufh (str)
return;
inst.instruction |= ((number & 0xf0) << 16) | (number & 0xf);
- return;
}
static void
@@ -6509,7 +6476,6 @@ do_iwmmxt_wzero (str)
return;
inst.instruction |= ((inst.instruction & 0xf) << 12) | ((inst.instruction & 0xf) << 16);
- return;
}
/* Xscale multiply-accumulate (argument parse)
@@ -7298,7 +7264,6 @@ do_arit (str)
}
end_of_line (str);
- return;
}
static void
@@ -7355,8 +7320,6 @@ do_adrl (str)
inst.reloc.exp.X_add_number -= 8; /* PC relative adjust */
inst.reloc.pc_rel = 1;
inst.size = INSN_SIZE * 2;
-
- return;
}
static void
@@ -7381,7 +7344,6 @@ do_cmp (str)
}
end_of_line (str);
- return;
}
static void
@@ -7406,7 +7368,6 @@ do_mov (str)
}
end_of_line (str);
- return;
}
static int
@@ -7657,7 +7618,6 @@ do_ldst (str)
inst.instruction |= (pre_inc ? PRE_INDEX : 0);
end_of_line (str);
- return;
}
static void
@@ -7736,7 +7696,6 @@ do_ldstt (str)
}
end_of_line (str);
- return;
}
static int
@@ -7992,7 +7951,6 @@ do_ldstv4 (str)
inst.instruction |= (pre_inc ? PRE_INDEX : 0);
end_of_line (str);
- return;
}
static long
@@ -8189,7 +8147,6 @@ do_ldmstm (str)
inst.instruction |= range;
end_of_line (str);
- return;
}
static void
@@ -8208,8 +8165,6 @@ do_swi (str)
inst.reloc.type = BFD_RELOC_ARM_SWI;
inst.reloc.pc_rel = 0;
end_of_line (str);
-
- return;
}
static void
@@ -8270,7 +8225,6 @@ do_swap (str)
}
end_of_line (str);
- return;
}
static void
@@ -8315,7 +8269,6 @@ do_branch (str)
#endif /* OBJ_ELF */
end_of_line (str);
- return;
}
static void
@@ -8397,7 +8350,6 @@ do_cdp (str)
}
end_of_line (str);
- return;
}
static void
@@ -8433,7 +8385,6 @@ do_lstc (str)
}
end_of_line (str);
- return;
}
static void
@@ -8495,7 +8446,6 @@ do_co_reg (str)
}
end_of_line (str);
- return;
}
static void
@@ -8515,7 +8465,6 @@ do_fpa_ctrl (str)
}
end_of_line (str);
- return;
}
static void
@@ -8711,7 +8660,6 @@ do_fpa_dyadic (str)
}
end_of_line (str);
- return;
}
static void
@@ -8736,7 +8684,6 @@ do_fpa_monadic (str)
}
end_of_line (str);
- return;
}
static void
@@ -8761,7 +8708,6 @@ do_fpa_cmp (str)
}
end_of_line (str);
- return;
}
static void
@@ -8786,7 +8732,6 @@ do_fpa_from_reg (str)
}
end_of_line (str);
- return;
}
static void
@@ -8807,7 +8752,6 @@ do_fpa_to_reg (str)
}
end_of_line (str);
- return;
}
static int
@@ -8906,7 +8850,6 @@ do_vfp_sp_monadic (str)
}
end_of_line (str);
- return;
}
static void
@@ -8927,7 +8870,6 @@ do_vfp_dp_monadic (str)
}
end_of_line (str);
- return;
}
static void
@@ -8950,7 +8892,6 @@ do_vfp_sp_dyadic (str)
}
end_of_line (str);
- return;
}
static void
@@ -8973,7 +8914,6 @@ do_vfp_dp_dyadic (str)
}
end_of_line (str);
- return;
}
static void
@@ -8994,7 +8934,6 @@ do_vfp_reg_from_sp (str)
}
end_of_line (str);
- return;
}
static void
@@ -9023,7 +8962,6 @@ do_vfp_sp_reg2 (str)
}
end_of_line (str);
- return;
}
static void
@@ -9044,7 +8982,6 @@ do_vfp_sp_from_reg (str)
}
end_of_line (str);
- return;
}
static void
@@ -9065,7 +9002,6 @@ do_vfp_reg_from_dp (str)
}
end_of_line (str);
- return;
}
static void
@@ -9088,7 +9024,6 @@ do_vfp_reg2_from_dp (str)
}
end_of_line (str);
- return;
}
static void
@@ -9109,7 +9044,6 @@ do_vfp_dp_from_reg (str)
}
end_of_line (str);
- return;
}
static void
@@ -9132,7 +9066,6 @@ do_vfp_dp_from_reg2 (str)
}
end_of_line (str);
- return;
}
static const struct vfp_reg *
@@ -9211,7 +9144,6 @@ do_vfp_reg_from_ctrl (str)
}
end_of_line (str);
- return;
}
static void
@@ -9232,7 +9164,6 @@ do_vfp_ctrl_from_reg (str)
}
end_of_line (str);
- return;
}
static void
@@ -9257,7 +9188,6 @@ do_vfp_sp_ldst (str)
}
end_of_line (str);
- return;
}
static void
@@ -9282,7 +9212,6 @@ do_vfp_dp_ldst (str)
}
end_of_line (str);
- return;
}
/* Parse and encode a VFP SP register list, storing the initial
@@ -9649,7 +9578,6 @@ do_vfp_sp_compare_z (str)
}
end_of_line (str);
- return;
}
static void
@@ -9666,7 +9594,6 @@ do_vfp_dp_compare_z (str)
}
end_of_line (str);
- return;
}
static void
@@ -9687,7 +9614,6 @@ do_vfp_dp_sp_cvt (str)
}
end_of_line (str);
- return;
}
static void
@@ -9708,7 +9634,6 @@ do_vfp_sp_dp_cvt (str)
}
end_of_line (str);
- return;
}
/* Thumb specific routines. */
@@ -10967,7 +10892,6 @@ do_mav_ldst (str, reg0)
fail_ldst:
if (!inst.error)
inst.error = BAD_ARGS;
- return;
}
static void
@@ -10976,7 +10900,6 @@ do_t_nop (str)
{
/* Do nothing. */
end_of_line (str);
- return;
}
/* Handle the Format 4 instructions that do not have equivalents in other
@@ -11350,7 +11273,6 @@ do_t_swi (str)
inst.reloc.type = BFD_RELOC_ARM_SWI;
end_of_line (str);
- return;
}
static void
@@ -13741,8 +13663,6 @@ fix_new_arm (frag, where, size, exp, pc_
arm_data = (arm_fix_data *) obstack_alloc (& notes, sizeof (arm_fix_data));
new_fix->tc_fix_data = (PTR) arm_data;
arm_data->thumb_mode = thumb_mode;
-
- return;
}
/* This fix_new is called by cons via TC_CONS_FIX_NEW. */
Index: tc-d30v.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-d30v.c,v
retrieving revision 1.23
diff -u -p -r1.23 tc-d30v.c
--- tc-d30v.c 21 Nov 2003 00:24:40 -0000 1.23
+++ tc-d30v.c 10 Dec 2003 04:30:19 -0000
@@ -2051,8 +2051,6 @@ check_size (value, bits, file, line)
if (tmp > max)
as_bad_where (file, line, _("value too large to fit in %d bits"), bits);
-
- return;
}
/* d30v_frob_label() is called when after a label is recognized. */
Index: tc-dlx.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-dlx.c,v
retrieving revision 1.7
diff -u -p -r1.7 tc-dlx.c
--- tc-dlx.c 21 Nov 2003 00:24:40 -0000 1.7
+++ tc-dlx.c 10 Dec 2003 04:30:20 -0000
@@ -369,7 +369,6 @@ md_begin ()
as_fatal (_("Broken assembler. No assembly attempted."));
define_some_regs ();
- return;
}
/* Assemble a single instruction. Its label has already been handled
@@ -1224,7 +1223,6 @@ md_apply_fix3 (fixP, valP, seg)
number_to_chars_bigendian (place, val, fixP->fx_size);
if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
- return;
}
const char *md_shortopts = "";
@@ -1248,7 +1246,6 @@ void
md_show_usage (stream)
FILE *stream ATTRIBUTE_UNUSED;
{
- return;
}
/* This is called when a line is unrecognized. */
Index: tc-h8300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-h8300.c,v
retrieving revision 1.44
diff -u -p -r1.44 tc-h8300.c
--- tc-h8300.c 26 Nov 2003 13:18:22 -0000 1.44
+++ tc-h8300.c 10 Dec 2003 04:30:23 -0000
@@ -973,7 +973,6 @@ get_mova_operands (char *op_end, struct
error:
as_bad (_("expected valid addressing mode for mova: \"@(disp, ea.sz),ERn\""));
- return;
}
static void
Index: tc-ia64.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.c,v
retrieving revision 1.94
diff -u -p -r1.94 tc-ia64.c
--- tc-ia64.c 21 Nov 2003 14:38:06 -0000 1.94
+++ tc-ia64.c 10 Dec 2003 04:30:35 -0000
@@ -10486,8 +10486,6 @@ ia64_validate_fix (fix)
default:
break;
}
-
- return;
}
static void
Index: tc-msp430.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-msp430.c,v
retrieving revision 1.8
diff -u -p -r1.8 tc-msp430.c
--- tc-msp430.c 22 Nov 2003 02:35:30 -0000 1.8
+++ tc-msp430.c 10 Dec 2003 04:30:36 -0000
@@ -1493,7 +1493,6 @@ md_apply_fix3 (fixp, valuep, seg)
{
fixp->fx_addnumber = value;
}
- return;
}
/* A `BFD_ASSEMBLER' GAS will call this to generate a reloc. GAS
Index: tc-z8k.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-z8k.c,v
retrieving revision 1.27
diff -u -p -r1.27 tc-z8k.c
--- tc-z8k.c 5 Dec 2003 23:40:04 -0000 1.27
+++ tc-z8k.c 10 Dec 2003 04:30:38 -0000
@@ -433,7 +433,6 @@ get_ctrl_operand (char **ptr, struct z8k
}
}
the_ctrl = 0;
- return;
}
struct flag_names {
@@ -481,7 +480,6 @@ get_flags_operand (char **ptr, struct z8
}
done:
*ptr = src + j;
- return;
}
struct interrupt_names {
@@ -525,7 +523,6 @@ get_interrupt_operand (char **ptr, struc
/* No interrupt type specified, opcode won't do anything. */
as_warn (_("opcode has no effect"));
the_interrupt = 0x0;
- return;
}
struct cc_names {
Index: xtensa-relax.c
===================================================================
RCS file: /cvs/src/src/gas/config/xtensa-relax.c,v
retrieving revision 1.2
diff -u -p -r1.2 xtensa-relax.c
--- xtensa-relax.c 22 Nov 2003 15:32:28 -0000 1.2
+++ xtensa-relax.c 10 Dec 2003 04:30:40 -0000
@@ -532,7 +532,6 @@ append_transition (tt, opcode, t)
nxt = nxt->next;
}
prev->next = tl;
- return;
}