aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-05-20 22:49:01 +0930
committerAlan Modra <amodra@gmail.com>2020-05-21 10:45:33 +0930
commit9fbb53c7c8d54ec90dc308cfb50902b90900b946 (patch)
tree8515c6ad77b83d750fc107937f06c8816c4dfc2e /gas/config
parent9db70fc3656064555873332003d842b880ca470c (diff)
downloadgdb-9fbb53c7c8d54ec90dc308cfb50902b90900b946.zip
gdb-9fbb53c7c8d54ec90dc308cfb50902b90900b946.tar.gz
gdb-9fbb53c7c8d54ec90dc308cfb50902b90900b946.tar.bz2
Replace "if (x) free (x)" with "free (x)", gas
* atof-generic.c: Replace "if (x) free (x)" with "free (x)" throughout. * config/obj-elf.c: Likewise. * config/tc-aarch64.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-m68k.c: Likewise. * config/tc-nios2.c: Likewise. * config/tc-tic30.c: Likewise. * ecoff.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. * symbols.c: Likewise. * testsuite/gas/all/test-gen.c: Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/obj-elf.c10
-rw-r--r--gas/config/tc-aarch64.c6
-rw-r--r--gas/config/tc-arm.c9
-rw-r--r--gas/config/tc-m68k.c3
-rw-r--r--gas/config/tc-nios2.c7
-rw-r--r--gas/config/tc-tic30.c3
6 files changed, 12 insertions, 26 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 4bdddc9..de22b5a 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -2021,8 +2021,7 @@ elf_copy_symbol_attributes (symbolS *dest, symbolS *src)
}
else
{
- if (destelf->size != NULL)
- free (destelf->size);
+ free (destelf->size);
destelf->size = NULL;
}
S_SET_SIZE (dest, S_GET_SIZE (src));
@@ -2124,11 +2123,8 @@ obj_elf_size (int ignore ATTRIBUTE_UNUSED)
if (exp.X_op == O_constant)
{
S_SET_SIZE (sym, exp.X_add_number);
- if (symbol_get_obj (sym)->size)
- {
- xfree (symbol_get_obj (sym)->size);
- symbol_get_obj (sym)->size = NULL;
- }
+ xfree (symbol_get_obj (sym)->size);
+ symbol_get_obj (sym)->size = NULL;
}
else
{
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index da786ba..728fd10 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -8269,8 +8269,7 @@ md_apply_fix (fixS * fixP, valueT * valP, segT seg)
/* Free the allocated the struct aarch64_inst.
N.B. currently there are very limited number of fix-up types actually use
this field, so the impact on the performance should be minimal . */
- if (fixP->tc_fix_data.inst != NULL)
- free (fixP->tc_fix_data.inst);
+ free (fixP->tc_fix_data.inst);
return;
}
@@ -9557,8 +9556,7 @@ aarch64_elf_copy_symbol_attributes (symbolS *dest, symbolS *src)
}
else
{
- if (destelf->size != NULL)
- free (destelf->size);
+ free (destelf->size);
destelf->size = NULL;
}
S_SET_SIZE (dest, S_GET_SIZE (src));
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index bc0b3a4..a693006 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -2899,8 +2899,7 @@ s_unreq (int a ATTRIBUTE_UNUSED)
hash_delete (arm_reg_hsh, name, FALSE);
free ((char *) reg->name);
- if (reg->neon)
- free (reg->neon);
+ free (reg->neon);
free (reg);
/* Also locate the all upper case and all lower case versions.
@@ -2915,8 +2914,7 @@ s_unreq (int a ATTRIBUTE_UNUSED)
{
hash_delete (arm_reg_hsh, nbuf, FALSE);
free ((char *) reg->name);
- if (reg->neon)
- free (reg->neon);
+ free (reg->neon);
free (reg);
}
@@ -2927,8 +2925,7 @@ s_unreq (int a ATTRIBUTE_UNUSED)
{
hash_delete (arm_reg_hsh, nbuf, FALSE);
free ((char *) reg->name);
- if (reg->neon)
- free (reg->neon);
+ free (reg->neon);
free (reg);
}
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index 490df5d..cbb227a 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -6135,8 +6135,7 @@ pop_mri_control (void)
n = mri_control_stack;
mri_control_stack = n->outer;
- if (n->top != NULL)
- free (n->top);
+ free (n->top);
free (n->next);
free (n->bottom);
free (n);
diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c
index 52cfb98..aeca351 100644
--- a/gas/config/tc-nios2.c
+++ b/gas/config/tc-nios2.c
@@ -3230,11 +3230,8 @@ nios2_insert_arg (char **parsed_args, const char *insert, int num,
static void
nios2_free_arg (char **parsed_args, int num ATTRIBUTE_UNUSED, int start)
{
- if (parsed_args[start])
- {
- free (parsed_args[start]);
- parsed_args[start] = NULL;
- }
+ free (parsed_args[start]);
+ parsed_args[start] = NULL;
}
/* This function swaps the pseudo-op for a real op. */
diff --git a/gas/config/tc-tic30.c b/gas/config/tc-tic30.c
index f1954d0..c31c760 100644
--- a/gas/config/tc-tic30.c
+++ b/gas/config/tc-tic30.c
@@ -1997,8 +1997,7 @@ md_assemble (char *line)
for (i = 0; i < insn.operands; i++)
{
- if (insn.operand_type[i]->immediate.label)
- free (insn.operand_type[i]->immediate.label);
+ free (insn.operand_type[i]->immediate.label);
free (insn.operand_type[i]);
}
}