Browse Source

gas: free sy_hash, macro_hash and po_hash

* macro.c (macro_end): New function.
	* macro.h (macro_end): Declare.
	* read.c (read_end, poend): New functions.
	* read.h (read_end): Declare.
	* symbols.c (symbol_end): New function.
	* symbols.h (symbol_end): Declare.
	* output-file.c (output_file_close): Call new *_end functions.
users/aburgess/try-mips-disasm-styling
Alan Modra 4 years ago
parent
commit
b18220936c
  1. 6
      gas/macro.c
  2. 1
      gas/macro.h
  3. 5
      gas/output-file.c
  4. 13
      gas/read.c
  5. 1
      gas/read.h
  6. 6
      gas/symbols.c
  7. 1
      gas/symbols.h

6
gas/macro.c

@ -84,6 +84,12 @@ macro_init (int alternate, int mri, int strip_at,
macro_expr = exp;
}
void
macro_end (void)
{
htab_delete (macro_hash);
}
/* Switch in and out of alternate mode on the fly. */
void

1
gas/macro.h

@ -85,6 +85,7 @@ extern int buffer_and_nest (const char *, const char *, sb *,
size_t (*) (sb *));
extern void macro_init (int, int, int,
size_t (*) (const char *, size_t, sb *, offsetT *));
extern void macro_end (void);
extern void macro_set_alternate (int);
extern void macro_mri_mode (int);
extern const char *define_macro (size_t, sb *, sb *, size_t (*) (sb *),

5
gas/output-file.c

@ -20,6 +20,8 @@
#include "as.h"
#include "subsegs.h"
#include "sb.h"
#include "macro.h"
#include "output-file.h"
#ifndef TARGET_MACH
@ -103,6 +105,9 @@ output_file_close (void)
if (!keep_it && filename)
unlink_if_ordinary (filename);
macro_end ();
read_end ();
symbol_end ();
subsegs_end (obs);
if (!res)

13
gas/read.c

@ -248,6 +248,7 @@ static void s_reloc (int);
static int hex_float (int, char *);
static segT get_known_segmented_expression (expressionS * expP);
static void pobegin (void);
static void poend (void);
static size_t get_non_macro_line_sb (sb *);
static void generate_file_debug (void);
static char *_find_end_of_line (char *, int, int, int);
@ -276,6 +277,12 @@ read_begin (void)
if (flag_mri)
lex_type['?'] = 3;
}
void
read_end (void)
{
poend ();
}
#ifndef TC_ADDRESS_BYTES
#define TC_ADDRESS_BYTES address_bytes
@ -561,6 +568,12 @@ pobegin (void)
pop_override_ok = 1;
cfi_pop_insert ();
}
static void
poend (void)
{
htab_delete (po_hash);
}
#define HANDLE_CONDITIONAL_ASSEMBLY(num_read) \
if (ignore_input ()) \

1
gas/read.h

@ -141,6 +141,7 @@ extern unsigned output_leb128 (char *, valueT, int);
extern void pseudo_set (symbolS * symbolP);
extern void read_a_source_file (const char *name);
extern void read_begin (void);
extern void read_end (void);
extern void read_print_statistics (FILE *);
extern char *read_symbol_name (void);
extern unsigned sizeof_leb128 (valueT, int);

6
gas/symbols.c

@ -3062,6 +3062,12 @@ symbol_begin (void)
fb_label_init ();
}
void
symbol_end (void)
{
htab_delete (sy_hash);
}
void
dot_symbol_init (void)
{

1
gas/symbols.h

@ -67,6 +67,7 @@ symbolS *symbol_temp_make (void);
symbolS *colon (const char *sym_name);
void local_colon (int n);
void symbol_begin (void);
void symbol_end (void);
void dot_symbol_init (void);
void symbol_print_statistics (FILE *);
void symbol_table_insert (symbolS * symbolP);

Loading…
Cancel
Save