{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
- text_section ();
+ function_section (current_function_decl);
sprintf (label, BLOCK_BEGIN_LABEL_FMT, blocknum);
ASM_OUTPUT_LABEL (asm_out_file, label);
}
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
- text_section ();
+ function_section (current_function_decl);
sprintf (label, BLOCK_END_LABEL_FMT, blocknum);
ASM_OUTPUT_LABEL (asm_out_file, label);
}
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
- text_section ();
+ function_section (current_function_decl);
sprintf (label, INSN_LABEL_FMT, current_funcdef_number,
(unsigned) INSN_UID (insn));
ASM_OUTPUT_LABEL (asm_out_file, label);
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
- text_section ();
+ function_section (current_function_decl);
sprintf (label, BODY_BEGIN_LABEL_FMT, current_funcdef_number);
ASM_OUTPUT_LABEL (asm_out_file, label);
}
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
- text_section ();
+ function_section (current_function_decl);
sprintf (label, BODY_END_LABEL_FMT, current_funcdef_number);
ASM_OUTPUT_LABEL (asm_out_file, label);
}
static unsigned prev_file_entry_num = (unsigned) -1;
register unsigned this_file_entry_num = lookup_filename (filename);
- text_section ();
+ function_section (current_function_decl);
sprintf (label, LINE_CODE_LABEL_FMT, ++last_line_entry_num);
ASM_OUTPUT_LABEL (asm_out_file, label);
/ BITS_PER_UNIT));
#endif /* READONLY_DATA_SECTION */
#else /* JUMP_TABLES_IN_TEXT_SECTION */
- text_section ();
+ function_section (current_function_decl);
#endif /* JUMP_TABLES_IN_TEXT_SECTION */
#ifdef ASM_OUTPUT_CASE_LABEL
ASM_OUTPUT_CASE_LABEL (file, "L", CODE_LABEL_NUMBER (insn),
insn);
#endif
- text_section ();
+ function_section (current_function_decl);
break;
}
If NAME is NULL, get the name from DECL. */
extern void named_section PROTO((tree, char *));
+/* Tell assembler to switch to the section for function DECL. */
+extern void function_section PROTO((tree));
+
/* Create the rtl to represent a function, for a function definition.
DECL is a FUNCTION_DECL node which describes which function.
The rtl is stored into DECL. */
#endif
}
}
+
+/* Switch to the section for function DECL.
+
+ If DECL is NULL_TREE, switch to the text section.
+ ??? It's not clear that we will ever be passed NULL_TREE, but it's
+ safer to handle it. */
+
+void
+function_section (decl)
+ tree decl;
+{
+ if (decl != NULL_TREE
+ && DECL_SECTION_NAME (decl) != NULL_TREE)
+ named_section (decl, (char *) 0);
+ else
+ text_section ();
+}
\f
/* Create the rtl to represent a function, for a function definition.
DECL is a FUNCTION_DECL node which describes which function.
output_constant_pool (fnname, decl);
- if (IN_NAMED_SECTION (decl))
- named_section (decl, NULL);
- else
- text_section ();
+ function_section (decl);
/* Tell assembler to move to target machine's alignment for functions. */
align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT);