aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
diff options
context:
space:
mode:
authorStrager Neds <strager.nds@gmail.com>2020-11-10 11:42:01 -0700
committerJeff Law <law@redhat.com>2020-11-10 11:44:15 -0700
commit8b9a92f794b8ad8011e6beb11a609efa635c4600 (patch)
tree015dae9357148c23ef517657a3b019656fd2ebd0 /gcc/cgraph.h
parent5e41e7f0928de55d189475fc14f7e6c9737cd507 (diff)
downloadgcc-8b9a92f794b8ad8011e6beb11a609efa635c4600.zip
gcc-8b9a92f794b8ad8011e6beb11a609efa635c4600.tar.gz
gcc-8b9a92f794b8ad8011e6beb11a609efa635c4600.tar.bz2
Refactor copying decl section names
gcc/ * cgraph.h (symtab_node::get_section): Constify. (symtab_node::set_section): Declare new overload. * symtab.c (symtab_node::set_section): Define new overload. (symtab_node::copy_visibility_from): Use new overload of symtab_node::set_section. (symtab_node::resolve_alias): Same. * tree.h (set_decl_section_name): Declare new overload. * tree.c (set_decl_section_name): Define new overload. * tree-emutls.c (get_emutls_init_templ_addr): Same. * cgraphclones.c (cgraph_node::create_virtual_clone): Use new overload of symtab_node::set_section. (cgraph_node::create_version_clone_with_body): Same. * trans-mem.c (ipa_tm_create_version): Same. gcc/c * c-decl.c (merge_decls): Use new overload of set_decl_section_name. gcc/cp * decl.c (duplicate_decls): Use new overload of set_decl_section_name. * method.c (use_thunk): Same. * optimize.c (maybe_clone_body): Same. * coroutines.cc (act_des_fn): Same. gcc/d * decl.cc (finish_thunk): Use new overload of set_decl_section_name
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r--gcc/cgraph.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 73c37d8..2e62db2 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -263,7 +263,7 @@ public:
}
/* Return section as string. */
- const char * get_section ()
+ const char * get_section () const
{
if (!x_section)
return NULL;
@@ -322,6 +322,9 @@ public:
/* Set section for symbol and its aliases. */
void set_section (const char *section);
+ /* Like set_section, but copying the section name from another node. */
+ void set_section (const symtab_node &other);
+
/* Set section, do not recurse into aliases.
When one wants to change section of symbol and its aliases,
use set_section. */