aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-xtensa.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-07-05 13:26:38 +0930
committerAlan Modra <amodra@gmail.com>2022-07-09 21:23:00 +0930
commited2917de68fe1ae3f279cef3b48c6464c75e9d72 (patch)
treeba4bd01e9de24ec8372dc32cb8041fe5bb2ebdc3 /gas/config/tc-xtensa.c
parentaf3d7ab74f0aff2eb2af68d0d1df2e27e5757ecd (diff)
downloadbinutils-ed2917de68fe1ae3f279cef3b48c6464c75e9d72.zip
binutils-ed2917de68fe1ae3f279cef3b48c6464c75e9d72.tar.gz
binutils-ed2917de68fe1ae3f279cef3b48c6464c75e9d72.tar.bz2
gas: rename md_end to md_finish
Currently md_end is typically used for some final actions rather than freeing memory like other *_end functions. Rename it to md_finish, and rename target implementation. The renaming of target functions makes it possible to find them all with "grep md_finish", eg. md_mips_end is renamed to mips_md_finish, not md_mips_finish. This patch leaves a number of md_end functions unchanged, those that either do nothing or deallocate memory, and calls them late. The idea here is that target maintainers implement md_end functions to tidy memory, if anyone cares. Freeing persistent memory in gas is not at all important, except that it can hide more important memory leaks, those that happen once per some frequent gas operation, amongst these unimportant memory leaks. * as.c (main): Rename md_end to md_finish. * config/tc-alpha.c, * config/tc-alpha.h, * config/tc-arc.c, * config/tc-arc.h, * config/tc-arm.c, * config/tc-arm.h, * config/tc-csky.c, * config/tc-csky.h, * config/tc-ia64.c, * config/tc-ia64.h, * config/tc-mcore.c, * config/tc-mcore.h, * config/tc-mips.c, * config/tc-mips.h, * config/tc-mmix.c, * config/tc-mmix.h, * config/tc-msp430.c, * config/tc-msp430.h, * config/tc-nds32.c, * config/tc-nds32.h, * config/tc-ppc.c, * config/tc-ppc.h, * config/tc-pru.c, * config/tc-pru.h, * config/tc-riscv.c, * config/tc-riscv.h, * config/tc-s390.c, * config/tc-s390.h, * config/tc-sparc.c, * config/tc-sparc.h, * config/tc-tic4x.c, * config/tc-tic4x.h, * config/tc-tic6x.c, * config/tc-tic6x.h, * config/tc-v850.c, * config/tc-v850.h, * config/tc-xtensa.c, * config/tc-xtensa.h, * config/tc-z80.c, * config/tc-z80.h: Similarly. * output-file.c (output_file_close): Call md_end.
Diffstat (limited to 'gas/config/tc-xtensa.c')
-rw-r--r--gas/config/tc-xtensa.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 3e3deb5..b7403ac 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -94,7 +94,7 @@ static enum debug_info_type xt_saved_debug_type = DEBUG_NONE;
/* Some functions are only valid in the front end. This variable
allows us to assert that we haven't crossed over into the
back end. */
-static bool past_xtensa_end = false;
+static bool past_xtensa_md_finish = false;
/* Flags for properties of the last instruction in a segment. */
#define FLAG_IS_A0_WRITER 0x1
@@ -1189,9 +1189,9 @@ const pseudo_typeS md_pseudo_table[] =
static bool
use_transform (void)
{
- /* After md_end, you should be checking frag by frag, rather
+ /* After md_finish, you should be checking frag by frag, rather
than state directives. */
- gas_assert (!past_xtensa_end);
+ gas_assert (!past_xtensa_md_finish);
return directive_state[directive_transform];
}
@@ -1199,10 +1199,10 @@ use_transform (void)
static bool
do_align_targets (void)
{
- /* Do not use this function after md_end; just look at align_targets
+ /* Do not use this function after md_finish; just look at align_targets
instead. There is no target-align directive, so alignment is either
enabled for all frags or not done at all. */
- gas_assert (!past_xtensa_end);
+ gas_assert (!past_xtensa_md_finish);
return align_targets && use_transform ();
}
@@ -4980,7 +4980,7 @@ xtensa_set_frag_assembly_state (fragS *fragP)
fragP->tc_frag_data.is_no_density = true;
/* This function is called from subsegs_finish, which is called
- after xtensa_end, so we can't use "use_transform" or
+ after xtensa_md_finish, so we can't use "use_transform" or
"use_schedule" here. */
if (!directive_state[directive_transform])
fragP->tc_frag_data.is_no_transform = true;
@@ -6600,7 +6600,7 @@ find_vinsn_conflicts (vliw_insn *vinsn)
int branches = 0;
xtensa_isa isa = xtensa_default_isa;
- gas_assert (!past_xtensa_end);
+ gas_assert (!past_xtensa_md_finish);
for (i = 0 ; i < vinsn->num_slots; i++)
{
@@ -7369,7 +7369,7 @@ xg_assemble_vliw_tokens (vliw_insn *vinsn)
}
-/* xtensa_end and helper functions. */
+/* xtensa_md_finish and helper functions. */
static void xtensa_cleanup_align_frags (void);
static void xtensa_fix_target_frags (void);
@@ -7384,12 +7384,12 @@ static void xtensa_sanity_check (void);
static void xtensa_add_config_info (void);
void
-xtensa_end (void)
+xtensa_md_finish (void)
{
directive_balance ();
xtensa_flush_pending_output ();
- past_xtensa_end = true;
+ past_xtensa_md_finish = true;
xtensa_move_literals ();
@@ -7927,7 +7927,7 @@ xtensa_maybe_create_literal_pool_frag (bool create, bool only_if_needed)
{
if (only_if_needed)
{
- if (past_xtensa_end || !use_transform() ||
+ if (past_xtensa_md_finish || !use_transform() ||
frag_now->tc_frag_data.is_no_transform)
{
return;