diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-19 13:27:18 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-19 13:27:18 +0000 |
commit | 470a0ecda2546f31ad9e7ff981808dd50fe10650 (patch) | |
tree | a35d25dbb6e404b8f7a02dc82c52069bfefb83ba /gcc/gimplify.c | |
parent | f0da0668ec829820b192962edf8827836876c47a (diff) | |
download | gcc-470a0ecda2546f31ad9e7ff981808dd50fe10650.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166943 138bc75d-0d04-0410-961f-82ee72b054a4
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 128ac0259bc..5cf84745625 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. |