summaryrefslogtreecommitdiff
path: root/gcc/dwarfout.c
diff options
context:
space:
mode:
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1993-11-24 02:20:47 +0000
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1993-11-24 02:20:47 +0000
commit8c691ed2336f1d6c5921edc07be381420f5c95a9 (patch)
tree46cf1e47220ac8f813bf8ebf242b2a513453f41c /gcc/dwarfout.c
parent47dc58db3638181a6488c78f02d70c11fd49ddc6 (diff)
downloadgcc-8c691ed2336f1d6c5921edc07be381420f5c95a9.tar.gz
(function_start_label): New function.
(output_entry_point_die): Use it. (output_global_subroutine_die, output_local_subroutine_die): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6153 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarfout.c')
-rw-r--r--gcc/dwarfout.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c
index 70dc51ed867..77b4297e0df 100644
--- a/gcc/dwarfout.c
+++ b/gcc/dwarfout.c
@@ -2986,6 +2986,28 @@ member_declared_type (member)
: TREE_TYPE (member);
}
+/* Get the function's label, as described by its RTL.
+ This may be different from the DECL_NAME name used
+ in the source file. */
+
+static char *
+function_start_label (decl)
+ register tree decl;
+{
+ rtx x;
+ char *fnname;
+
+ x = DECL_RTL (decl);
+ if (GET_CODE (x) != MEM)
+ abort ();
+ x = XEXP (x, 0);
+ if (GET_CODE (x) != SYMBOL_REF)
+ abort ();
+ fnname = XSTR (x, 0);
+ return fnname;
+}
+
+
/******************************* DIEs ************************************/
/* Output routines for individual types of DIEs. */
@@ -3055,7 +3077,7 @@ output_entry_point_die (arg)
if (DECL_ABSTRACT (decl))
equate_decl_number_to_die_number (decl);
else
- low_pc_attribute (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
+ low_pc_attribute (function_start_label (decl));
}
#endif
@@ -3214,7 +3236,7 @@ output_global_subroutine_die (arg)
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
- low_pc_attribute (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
+ low_pc_attribute (function_start_label (decl));
sprintf (label, FUNC_END_LABEL_FMT, current_funcdef_number);
high_pc_attribute (label);
sprintf (label, BODY_BEGIN_LABEL_FMT, current_funcdef_number);
@@ -3557,22 +3579,7 @@ output_local_subroutine_die (arg)
if (TREE_ASM_WRITTEN (decl))
{
char label[MAX_ARTIFICIAL_LABEL_BYTES];
- rtx x;
- char *fnname;
-
- /* Get the function's name, as described by its RTL.
- This may be different from the DECL_NAME name used
- in the source file. */
-
- x = DECL_RTL (decl);
- if (GET_CODE (x) != MEM)
- abort ();
- x = XEXP (x, 0);
- if (GET_CODE (x) != SYMBOL_REF)
- abort ();
- fnname = XSTR (x, 0);
-
- low_pc_attribute (fnname);
+ low_pc_attribute (function_start_label (decl));
sprintf (label, FUNC_END_LABEL_FMT, current_funcdef_number);
high_pc_attribute (label);
sprintf (label, BODY_BEGIN_LABEL_FMT, current_funcdef_number);