# define SFRAME_FRE_TYPE_SELECTION_OPT 1
#endif
+/* List of SFrame FDE entries. */
+
+static struct sframe_func_entry *all_sframe_fdes = NULL;
+
+/* Tail of the list to add to. */
+
+static struct sframe_func_entry **last_sframe_fde = &all_sframe_fdes;
+
/* Emit a single byte into the current segment. */
static inline void
#endif
+static struct sframe_row_entry*
+sframe_row_entry_new (void)
+{
+ struct sframe_row_entry *fre = XCNEW (struct sframe_row_entry);
+ /* Reset cfa_base_reg to -1. A value of 0 will imply some valid register
+ for the supported arches. */
+ fre->cfa_base_reg = SFRAME_FRE_BASE_REG_INVAL;
+ fre->merge_candidate = true;
+ /* Reset the mangled RA status bit to zero by default. We will
+ initialize it in sframe_row_entry_initialize () with the sticky
+ bit if set. */
+ fre->mangled_ra_p = false;
+
+ return fre;
+}
+
+static void
+sframe_row_entry_free (struct sframe_row_entry *fre)
+{
+ while (fre)
+ {
+ struct sframe_row_entry *fre_next = fre->next;
+ XDELETE (fre);
+ fre = fre_next;
+ }
+}
+
+/* Allocate an SFrame FDE. */
+
+static struct sframe_func_entry*
+sframe_fde_alloc (void)
+{
+ return XCNEW (struct sframe_func_entry);
+}
+
+/* Free up the SFrame FDE. */
+
+static void
+sframe_fde_free (struct sframe_func_entry *sframe_fde)
+{
+ sframe_row_entry_free (sframe_fde->sframe_fres);
+ XDELETE (sframe_fde);
+}
+
static void
output_sframe_row_entry (symbolS *fde_start_addr,
symbolS *fde_end_addr,
symbolS *end_of_frame_section;
symbolS *start_of_func_desc_section;
symbolS *start_of_fre_section;
- struct sframe_func_entry *sframe_fde;
+ struct sframe_func_entry *sframe_fde, *sframe_fde_next;
struct sframe_row_entry *sframe_fre;
unsigned char abi_arch = 0;
int fixed_fp_offset = SFRAME_CFA_FIXED_FP_INVALID;
/* The function descriptor entries as dumped by the assembler are not
sorted on PCs. */
unsigned char sframe_flags = 0;
- sframe_flags |= !SFRAME_F_FDE_SORTED;
unsigned int num_fdes = get_num_sframe_fdes ();
unsigned int num_fres = get_num_sframe_fres ();
i = 0;
sframe_fde = all_sframe_fdes;
- for (sframe_fde = all_sframe_fdes; sframe_fde; sframe_fde = sframe_fde->next)
+ for (sframe_fde = all_sframe_fdes; sframe_fde; sframe_fde = sframe_fde_next)
{
for (sframe_fre = sframe_fde->sframe_fres;
sframe_fre;
sframe_fre);
i++;
}
+ sframe_fde_next = sframe_fde->next;
+ sframe_fde_free (sframe_fde);
}
+ all_sframe_fdes = NULL;
+ last_sframe_fde = &all_sframe_fdes;
symbol_set_value_now (end_of_frame_section);
fre_symbols = NULL;
}
-/* List of SFrame FDE entries. */
-
-struct sframe_func_entry *all_sframe_fdes;
-
-/* Tail of the list to add to. */
-
-static struct sframe_func_entry **last_sframe_fde = &all_sframe_fdes;
-
static unsigned int
get_num_sframe_fdes (void)
{
return total_fres;
}
-/* Allocate an SFrame FDE. */
-
-static struct sframe_func_entry*
-sframe_fde_alloc (void)
-{
- struct sframe_func_entry *sframe_fde = XCNEW (struct sframe_func_entry);
- return sframe_fde;
-}
-
-/* Link the SFrame FDE in. */
-
-static int
-sframe_fde_link (struct sframe_func_entry *sframe_fde)
-{
- *last_sframe_fde = sframe_fde;
- last_sframe_fde = &sframe_fde->next;
-
- return 0;
-}
-
-/* Free up the SFrame FDE. */
-
-static void
-sframe_fde_free (struct sframe_func_entry *sframe_fde)
-{
- XDELETE (sframe_fde);
- sframe_fde = NULL;
-}
-
/* SFrame translation context functions. */
/* Allocate a new SFrame translation context. */
static void
sframe_xlate_ctx_cleanup (struct sframe_xlate_ctx *xlate_ctx)
{
- struct sframe_row_entry *fre, *fre_next;
-
- if (xlate_ctx->num_xlate_fres)
- {
- fre = xlate_ctx->first_fre;
- while (fre)
- {
- fre_next = fre->next;
- XDELETE (fre);
- fre = fre_next;
- }
- }
-
+ sframe_row_entry_free (xlate_ctx->first_fre);
+ XDELETE (xlate_ctx->remember_fre);
XDELETE (xlate_ctx->cur_fre);
-
- sframe_xlate_ctx_init (xlate_ctx);
}
/* Transfer the state from the SFrame translation context to the SFrame FDE. */
sframe_fde->num_fres = xlate_ctx->num_xlate_fres;
}
-static struct sframe_row_entry*
-sframe_row_entry_new (void)
-{
- struct sframe_row_entry *fre = XCNEW (struct sframe_row_entry);
- /* Reset cfa_base_reg to -1. A value of 0 will imply some valid register
- for the supported arches. */
- fre->cfa_base_reg = SFRAME_FRE_BASE_REG_INVAL;
- fre->merge_candidate = true;
- /* Reset the mangled RA status bit to zero by default. We will initialize it in
- sframe_row_entry_initialize () with the sticky bit if set. */
- fre->mangled_ra_p = false;
-
- return fre;
-}
-
/* Add the given FRE in the list of frame row entries in the given FDE
translation context. */
/* All done. Transfer the state from the SFrame translation
context to the SFrame FDE. */
sframe_xlate_ctx_finalize (xlate_ctx, sframe_fde);
- sframe_fde_link (sframe_fde);
+ *last_sframe_fde = sframe_fde;
+ last_sframe_fde = &sframe_fde->next;
}
}