]> gcc.gnu.org Git - gcc.git/commitdiff
varasm.c (function_section): New function.
authorDoug Evans <dje@gnu.org>
Mon, 13 Feb 1995 22:08:43 +0000 (22:08 +0000)
committerDoug Evans <dje@gnu.org>
Mon, 13 Feb 1995 22:08:43 +0000 (22:08 +0000)
* 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.

From-SVN: r8942

gcc/dwarfout.c
gcc/final.c
gcc/output.h
gcc/varasm.c

index 4287e106a09054f3cbe27c6200f64453aaf3735a..3ebff0108f197b5c8f7fce430811225b2f64def7 100644 (file)
@@ -4923,7 +4923,7 @@ dwarfout_begin_block (blocknum)
 {
   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);
 }
@@ -4937,7 +4937,7 @@ dwarfout_end_block (blocknum)
 {
   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);
 }
@@ -4953,7 +4953,7 @@ dwarfout_label (insn)
     {
       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);
@@ -4969,7 +4969,7 @@ dwarfout_begin_function ()
 {
   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);
 }
@@ -4982,7 +4982,7 @@ dwarfout_end_function ()
 {
   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);
 }
@@ -5156,7 +5156,7 @@ dwarfout_line (filename, line)
       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);
 
index 5d62c92d21291fc124b4ffd85f8312e6f91a4ce1..c086dd09bbaf1f88d55ed3e24a0d937b56ddc3eb 100644 (file)
@@ -1511,7 +1511,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
                                            / 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),
@@ -1600,7 +1600,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
                                 insn);
 #endif
 
-           text_section ();
+           function_section (current_function_decl);
 
            break;
          }
index 7922d64ef3f0f746bf08787870980036929dbd2e..c1a8ae67e0d7396e4512c05bb4d57c4bf720fd67 100644 (file)
@@ -136,6 +136,9 @@ extern int in_text_section          PROTO((void));
    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.  */
index a89de1a541e360a1ead4de1aeacbf3d2a9dfac70..9091023ff4cd16389c067b7373dbd29a3814f29c 100644 (file)
@@ -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 ();
+}
 \f
 /* 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);
This page took 0.078345 seconds and 5 git commands to generate.