aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@cygnus.com>1998-07-30 10:38:22 +0000
committerKen Raeburn <raeburn@gcc.gnu.org>1998-07-30 10:38:22 +0000
commit07417085a14349cde788c5cc10663815da40c26f (patch)
tree026e48c190a03450b58622639d6f3e00ed5ec047 /gcc/tree.h
parent6bcf8e5a040d2ce78eba4b4a143a216e2cea4ab5 (diff)
downloadgcc-07417085a14349cde788c5cc10663815da40c26f.zip
gcc-07417085a14349cde788c5cc10663815da40c26f.tar.gz
gcc-07417085a14349cde788c5cc10663815da40c26f.tar.bz2
Function entry/exit profiling instrumentation:
* expr.h (profile_function_entry_libfunc, profile_function_exit_libfunc): Declare new variables. * optabs.c: Define them here. (init_optabs): Initialize them. * tree.h (struct tree_decl): New flag no_instrument_function_entry_exit. (DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT): New accessor macro. * c-decl.c (duplicate_decls): Merge it. * c-common.c (enum attrs): New value A_NO_INSTRUMENT_FUNCTION. (init_attributes): Use it for "no_instrument_function". (decl_attributes): Handle it, for functions that have not yet been compiled. Set decl flag. * flags.h (flag_instrument_function_entry_exit): Declare new variable. * toplev.c (flag_instrument_function_entry_exit): Define it here. (f_options): New option "instrument-functions". * function.h (struct function): New field instrument_entry_exit. * function.c (current_function_instrument_entry_exit): New variable. (push_function_context_to, pop_function_context_from): Save and restore. (expand_function_start): Set current_ variable, maybe emit return label and entry profile call. (expand_function_end): Maybe emit exit profile call. Testsuite: * gcc.c-torture/special/eeprof-1.c: New test, for -finstrument-functions. * gcc.c-torture/special/special.exp: Run it. From-SVN: r21495
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 703c94e..401e5ee 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1201,6 +1201,10 @@ struct tree_type
multiple translation units should be merged. */
#define DECL_ONE_ONLY(NODE) (DECL_CHECK (NODE)->decl.transparent_union)
+/* Used in FUNCTION_DECLs to indicate that function entry and exit should
+ be instrumented with calls to support routines. */
+#define DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT(NODE) ((NODE)->decl.no_instrument_function_entry_exit)
+
/* Additional flags for language-specific uses. */
#define DECL_LANG_FLAG_0(NODE) (DECL_CHECK (NODE)->decl.lang_flag_0)
#define DECL_LANG_FLAG_1(NODE) (DECL_CHECK (NODE)->decl.lang_flag_1)
@@ -1245,7 +1249,6 @@ struct tree_decl
unsigned static_dtor_flag : 1;
unsigned artificial_flag : 1;
unsigned weak_flag : 1;
- /* room for no more */
unsigned lang_flag_0 : 1;
unsigned lang_flag_1 : 1;
@@ -1257,6 +1260,7 @@ struct tree_decl
unsigned lang_flag_7 : 1;
unsigned non_addr_const_p : 1;
+ unsigned no_instrument_function_entry_exit : 1;
/* For a FUNCTION_DECL, if inline, this is the size of frame needed.
If built-in, this is the code for which built-in function.