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/opts.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/opts.c')
-rw-r--r-- | gcc/opts.c | 50 |
1 files changed, 7 insertions, 43 deletions
@@ -319,15 +319,10 @@ struct visibility_flags visibility_options; /* What to print when a switch has no documentation. */ static const char undocumented_msg[] = N_("This switch lacks documentation"); -/* Functions excluded from profiling. */ - typedef char *char_p; /* For DEF_VEC_P. */ DEF_VEC_P(char_p); DEF_VEC_ALLOC_P(char_p,heap); -static VEC(char_p,heap) *flag_instrument_functions_exclude_functions; -static VEC(char_p,heap) *flag_instrument_functions_exclude_files; - typedef const char *const_char_p; /* For DEF_VEC_P. */ DEF_VEC_P(const_char_p); DEF_VEC_ALLOC_P(const_char_p,heap); @@ -545,12 +540,13 @@ add_input_filename (const char *filename) /* Add comma-separated strings to a char_p vector. */ static void -add_comma_separated_to_vector (VEC(char_p,heap) **pvec, const char* arg) +add_comma_separated_to_vector (void **pvec, const char *arg) { char *tmp; char *r; char *w; char *token_start; + VEC(char_p,heap) *vec = (VEC(char_p,heap) *) *pvec; /* We never free this string. */ tmp = xstrdup (arg); @@ -565,7 +561,7 @@ add_comma_separated_to_vector (VEC(char_p,heap) **pvec, const char* arg) { *w++ = '\0'; ++r; - VEC_safe_push (char_p, heap, *pvec, token_start); + VEC_safe_push (char_p, heap, vec, token_start); token_start = w; } if (*r == '\\' && r[1] == ',') @@ -577,43 +573,11 @@ add_comma_separated_to_vector (VEC(char_p,heap) **pvec, const char* arg) *w++ = *r++; } if (*token_start != '\0') - VEC_safe_push (char_p, heap, *pvec, token_start); -} - -/* Return whether we should exclude FNDECL from instrumentation. */ + VEC_safe_push (char_p, heap, vec, token_start); -bool -flag_instrument_functions_exclude_p (tree fndecl) -{ - if (VEC_length (char_p, flag_instrument_functions_exclude_functions) > 0) - { - const char *name; - int i; - char *s; - - name = lang_hooks.decl_printable_name (fndecl, 0); - FOR_EACH_VEC_ELT (char_p, flag_instrument_functions_exclude_functions, - i, s) - if (strstr (name, s) != NULL) - return true; - } - - if (VEC_length (char_p, flag_instrument_functions_exclude_files) > 0) - { - const char *name; - int i; - char *s; - - name = DECL_SOURCE_FILE (fndecl); - FOR_EACH_VEC_ELT (char_p, flag_instrument_functions_exclude_files, i, s) - if (strstr (name, s) != NULL) - return true; - } - - return false; + *pvec = vec; } - /* Handle the vector of command line options (located at LOC), storing the results of processing DECODED_OPTIONS and DECODED_OPTIONS_COUNT in OPTS and OPTS_SET and using DC for diagnostic state. LANG_MASK @@ -1918,12 +1882,12 @@ common_handle_option (struct gcc_options *opts, case OPT_finstrument_functions_exclude_function_list_: add_comma_separated_to_vector - (&flag_instrument_functions_exclude_functions, arg); + (&opts->x_flag_instrument_functions_exclude_functions, arg); break; case OPT_finstrument_functions_exclude_file_list_: add_comma_separated_to_vector - (&flag_instrument_functions_exclude_files, arg); + (&opts->x_flag_instrument_functions_exclude_files, arg); break; case OPT_fmessage_length_: |