diff options
author | Joseph Myers <joseph@codesourcery.com> | 2010-11-19 13:27:18 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2010-11-19 13:27:18 +0000 |
commit | 6a1f6c9c8645b35f6704ded5f1f3f9186dadc109 (patch) | |
tree | a35d25dbb6e404b8f7a02dc82c52069bfefb83ba /gcc/gimplify.c | |
parent | 21bf1558203226d4191d93a0b110b46611782f72 (diff) | |
download | gcc-6a1f6c9c8645b35f6704ded5f1f3f9186dadc109.zip gcc-6a1f6c9c8645b35f6704ded5f1f3f9186dadc109.tar.gz gcc-6a1f6c9c8645b35f6704ded5f1f3f9186dadc109.tar.bz2 |
common.opt (flag_instrument_functions_exclude_functions, [...]): New Variable definitions.
* common.opt (flag_instrument_functions_exclude_functions,
flag_instrument_functions_exclude_files): New Variable
definitions.
* flags.h (flag_instrument_functions_exclude_p): Don't declare.
* gimplify.c (char_p): Declare type and vectors.
(flag_instrument_functions_exclude_p): Moved from opts.c. Make
static.
* opts.c (flag_instrument_functions_exclude_functions,
flag_instrument_functions_exclude_files): Remove.
(add_comma_separated_to_vector): Take void **.
(flag_instrument_functions_exclude_p): Move to gimplify.c.
(common_handle_option): Use options structure for
-finstrument-functions-exclude- options.
From-SVN: r166943
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 128ac02..5cf8474 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -7762,6 +7762,46 @@ gimplify_body (tree *body_p, tree fndecl, bool do_parms) return outer_bind; } +typedef char *char_p; /* For DEF_VEC_P. */ +DEF_VEC_P(char_p); +DEF_VEC_ALLOC_P(char_p,heap); + +/* Return whether we should exclude FNDECL from instrumentation. */ + +static bool +flag_instrument_functions_exclude_p (tree fndecl) +{ + VEC(char_p,heap) *vec; + + vec = (VEC(char_p,heap) *) flag_instrument_functions_exclude_functions; + if (VEC_length (char_p, vec) > 0) + { + const char *name; + int i; + char *s; + + name = lang_hooks.decl_printable_name (fndecl, 0); + FOR_EACH_VEC_ELT (char_p, vec, i, s) + if (strstr (name, s) != NULL) + return true; + } + + vec = (VEC(char_p,heap) *) flag_instrument_functions_exclude_files; + if (VEC_length (char_p, vec) > 0) + { + const char *name; + int i; + char *s; + + name = DECL_SOURCE_FILE (fndecl); + FOR_EACH_VEC_ELT (char_p, vec, i, s) + if (strstr (name, s) != NULL) + return true; + } + + return false; +} + /* Entry point to the gimplification pass. FNDECL is the FUNCTION_DECL node for the function we want to gimplify. |