summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-13 01:58:45 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-13 01:58:45 +0000
commit3590147160cf77ac2afb72e80fd68d6ac0c3977b (patch)
tree620724275961c3e490611bea34f8d2c8cba0a9dd /gcc/function.c
parenta2ebbb48809073ff0ad025e7ab625bf9c3ec5b0a (diff)
downloadgcc-3590147160cf77ac2afb72e80fd68d6ac0c3977b.tar.gz
PR c++/13376
* function.h (struct function): Kill `name' field. (current_function_name): Make it an extern function. * function.c (current_function_name): New function. * graph.c: Update all uses of current_function_name. * gcse.c: Likewise. * config/alpha/alpha.c, config/avr/avr.c, config/c4x/c4x.c, config/mips/mips.c, config/pdp11/pdp11.c: Likewise. * config/ip2k/ip2k.c (function_prologue): Use MAIN_NAME_P instead of a strcmp with "main". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75784 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 30ede39ef02..02f095a19b3 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6408,8 +6408,6 @@ allocate_struct_function (tree fndecl)
DECL_SAVED_INSNS (fndecl) = cfun;
cfun->decl = fndecl;
- current_function_name = (*lang_hooks.decl_printable_name) (fndecl, 2);
-
result = DECL_RESULT (fndecl);
if (aggregate_value_p (result, fndecl))
{
@@ -8070,4 +8068,11 @@ init_function_once (void)
VARRAY_INT_INIT (sibcall_epilogue, 0, "sibcall_epilogue");
}
+/* Returns the name of the current function. */
+const char *
+current_function_name (void)
+{
+ return (*lang_hooks.decl_printable_name) (cfun->decl, 2);
+}
+
#include "gt-function.h"