Re: [PATCH] Remove unused function make_unique_name.
On 9/13/2021 6:16 PM, Benjamin Peterson wrote: * attribs.c (make_unique_name): Delete. * attribs.h (make_unique_name): Delete. Thanks. Installed on the trunk. jeff
[PATCH] Remove unused function make_unique_name.
Signed-off-by: Benjamin Peterson gcc/ * attribs.c (make_unique_name): Delete. * attribs.h (make_unique_name): Delete. --- gcc/attribs.c | 34 -- gcc/attribs.h | 1 - 2 files changed, 35 deletions(-) diff --git a/gcc/attribs.c b/gcc/attribs.c index 0d22c20a35e..83fafc98b7d 100644 --- a/gcc/attribs.c +++ b/gcc/attribs.c @@ -1022,40 +1022,6 @@ common_function_versions (tree fn1, tree fn2) return result; } -/* Return a new name by appending SUFFIX to the DECL name. If make_unique - is true, append the full path name of the source file. */ - -char * -make_unique_name (tree decl, const char *suffix, bool make_unique) -{ - char *global_var_name; - int name_len; - const char *name; - const char *unique_name = NULL; - - name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); - - /* Get a unique name that can be used globally without any chances - of collision at link time. */ - if (make_unique) -unique_name = IDENTIFIER_POINTER (get_file_function_name ("\0")); - - name_len = strlen (name) + strlen (suffix) + 2; - - if (make_unique) -name_len += strlen (unique_name) + 1; - global_var_name = XNEWVEC (char, name_len); - - /* Use '.' to concatenate names as it is demangler friendly. */ - if (make_unique) -snprintf (global_var_name, name_len, "%s.%s.%s", name, unique_name, - suffix); - else -snprintf (global_var_name, name_len, "%s.%s", name, suffix); - - return global_var_name; -} - /* Make a dispatcher declaration for the multi-versioned function DECL. Calls to DECL function will be replaced with calls to the dispatcher by the front-end. Return the decl created. */ diff --git a/gcc/attribs.h b/gcc/attribs.h index 87231b954c6..138c509bce1 100644 --- a/gcc/attribs.h +++ b/gcc/attribs.h @@ -44,7 +44,6 @@ extern struct scoped_attributes* register_scoped_attributes (const struct attrib extern char *sorted_attr_string (tree); extern bool common_function_versions (tree, tree); -extern char *make_unique_name (tree, const char *, bool); extern tree make_dispatcher_decl (const tree); extern bool is_function_default_version (const tree); -- 2.30.2
[PATCH] Remove unused function
This function is unused since matrix-reorg.c removal back in 2012. I think there's no point in keeping it around. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2015-03-16 Marek Polacek pola...@redhat.com * cgraph.h (add_new_static_var): Remove declaration. * varpool.c (add_new_static_var): Remove function. diff --git gcc/cgraph.h gcc/cgraph.h index 99af026..52b15c5 100644 --- gcc/cgraph.h +++ gcc/cgraph.h @@ -2717,9 +2717,6 @@ cgraph_node::has_gimple_body_p (void) for ((node) = symtab-first_function_with_gimple_body (); (node); \ (node) = symtab-next_function_with_gimple_body (node)) -/* Create a new static variable of type TYPE. */ -tree add_new_static_var (tree type); - /* Uniquize all constants that appear in memory. Each constant in memory thus far output is recorded in `const_desc_table'. */ diff --git gcc/varpool.c gcc/varpool.c index ce64279..f1439ca 100644 --- gcc/varpool.c +++ gcc/varpool.c @@ -760,27 +760,6 @@ symbol_table::output_variables (void) return changed; } -/* Create a new global variable of type TYPE. */ -tree -add_new_static_var (tree type) -{ - tree new_decl; - varpool_node *new_node; - - new_decl = create_tmp_var_raw (type); - DECL_NAME (new_decl) = create_tmp_var_name (NULL); - TREE_READONLY (new_decl) = 0; - TREE_STATIC (new_decl) = 1; - TREE_USED (new_decl) = 1; - DECL_CONTEXT (new_decl) = NULL_TREE; - DECL_ABSTRACT_P (new_decl) = false; - lang_hooks.dup_lang_specific_decl (new_decl); - new_node = varpool_node::get_create (new_decl); - varpool_node::finalize_decl (new_decl); - - return new_node-decl; -} - /* Attempt to mark ALIAS as an alias to DECL. Return TRUE if successful. Extra name aliases are output whenever DECL is output. */ Marek
Re: [PATCH] Remove unused function
On 03/16/15 07:36, Marek Polacek wrote: This function is unused since matrix-reorg.c removal back in 2012. I think there's no point in keeping it around. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2015-03-16 Marek Polacek pola...@redhat.com * cgraph.h (add_new_static_var): Remove declaration. * varpool.c (add_new_static_var): Remove function. OK. jeff