From: Chung-Ju Wu Date: Sun, 1 Apr 2018 08:52:24 +0000 (+0000) Subject: [NDS32] Implement PROFILE_HOOK. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9e362bd034571dd74db4b2874515f20d1731ab30;p=gcc.git [NDS32] Implement PROFILE_HOOK. gcc/ * config/nds32/nds32.h (FUNCTION_PROFILER): Output newline character. (PROFILE_HOOK): Define its implementation. From-SVN: r258996 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8c97086a319..a2a7151b726 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-04-01 Chung-Ju Wu + + * config/nds32/nds32.h (FUNCTION_PROFILER): Output newline character. + (PROFILE_HOOK): Define its implementation. + 2018-04-01 Chung-Ju Wu * config/nds32/nds32.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Use unsigned int diff --git a/gcc/config/nds32/nds32.h b/gcc/config/nds32/nds32.h index 3ac071872b9..42a1c1296a5 100644 --- a/gcc/config/nds32/nds32.h +++ b/gcc/config/nds32/nds32.h @@ -801,7 +801,15 @@ enum reg_class #define EXIT_IGNORE_STACK 1 #define FUNCTION_PROFILER(file, labelno) \ - fprintf (file, "/* profiler %d */", (labelno)) + fprintf (file, "/* profiler %d */\n", (labelno)) + +#define PROFILE_HOOK(LABEL) \ + { \ + rtx fun, lp; \ + lp = get_hard_reg_initial_val (Pmode, LP_REGNUM); \ + fun = gen_rtx_SYMBOL_REF (Pmode, "_mcount"); \ + emit_library_call (fun, LCT_NORMAL, VOIDmode, lp, Pmode); \ + } /* Implementing the Varargs Macros. */