summaryrefslogtreecommitdiffstats
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>1995-02-13 22:08:43 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>1995-02-13 22:08:43 +0000
commitb409d58e5283680cf6dade805ed93c8141d2870b (patch)
tree7bd2f95374619b6a13422a2c5117a19e9e8daf02 /gcc/varasm.c
parent560e7d641e10b41391d7d9bbc6edb124df997cd9 (diff)
downloadppe42-gcc-b409d58e5283680cf6dade805ed93c8141d2870b.tar.gz
ppe42-gcc-b409d58e5283680cf6dade805ed93c8141d2870b.zip
* varasm.c (function_section): New function.
(assemble_start_function): Call it. * output.h (function_section): Declare it. * final.c (final_scan_insn): Call function_section instead of text_section. * dwarfout.c (dwarfout_begin_block): Likewise. (dwarfout_end_block): Likewise. (dwarfout_label): Likewise. (dwarfout_begin_function): Likewise. (dwarfout_end_function): Likewise. (dwarfout_line): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8942 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index a89de1a541e..9091023ff4c 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -244,6 +244,23 @@ named_section (decl, name)
#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 ();
+}
/* Create the rtl to represent a function, for a function definition.
DECL is a FUNCTION_DECL node which describes which function.
@@ -733,10 +750,7 @@ assemble_start_function (decl, fnname)
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);
OpenPOWER on IntegriCloud