aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-12-09 10:00:42 +0100
committerMartin Liska <marxin@gcc.gnu.org>2019-12-09 09:00:42 +0000
commita65d584dc1aaaad77af0a8e2ab36a29729d6e056 (patch)
tree6f7bf76913286dec5edeaaf3fd0e6dedbbb51f74 /gcc/cgraph.c
parent4383959047812511798e397511c9f4904eafe23d (diff)
downloadgcc-a65d584dc1aaaad77af0a8e2ab36a29729d6e056.zip
gcc-a65d584dc1aaaad77af0a8e2ab36a29729d6e056.tar.gz
gcc-a65d584dc1aaaad77af0a8e2ab36a29729d6e056.tar.bz2
Come up with constructors of symtab_node, cgraph_node and varpool_node.
2019-12-09 Martin Liska <mliska@suse.cz> PR ipa/92737 * cgraph.c (symbol_table_test::symbol_table_test): Fix coding style. * cgraph.h (symtab_node::symtab_node): New constructor. (cgraph_node::cgraph_node): Likewise. (varpool_node::varpool_node): Likewise. (symbol_table::allocate_cgraph_symbol): Use newly created constructor. (symbol_table::allocate_cgraph_symbol): Remove. * cgraphunit.c (symtab_terminator): Likewise. * varpool.c (varpool_node::create_empty): Use newly created constructor. From-SVN: r279109
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 5c72e83..5c7a03d 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -283,14 +283,8 @@ symbol_table::initialize (void)
cgraph_node *
symbol_table::create_empty (void)
{
- cgraph_node *node = allocate_cgraph_symbol ();
-
- node->type = SYMTAB_FUNCTION;
- node->frequency = NODE_FREQUENCY_NORMAL;
- node->count_materialization_scale = REG_BR_PROB_BASE;
cgraph_count++;
-
- return node;
+ return new (ggc_alloc<cgraph_node> ()) cgraph_node (cgraph_max_uid++);
}
/* Register HOOK to be called with DATA on each removed edge. */
@@ -510,8 +504,6 @@ cgraph_node::create (tree decl)
node->decl = decl;
- node->count = profile_count::uninitialized ();
-
if ((flag_openacc || flag_openmp)
&& lookup_attribute ("omp declare target", DECL_ATTRIBUTES (decl)))
{
@@ -3750,7 +3742,7 @@ symbol_table_test::symbol_table_test ()
{
gcc_assert (saved_symtab == NULL);
saved_symtab = symtab;
- symtab = new (ggc_alloc <symbol_table> ()) symbol_table ();
+ symtab = new (ggc_alloc<symbol_table> ()) symbol_table ();
}
/* Destructor. Restore the old value of symtab. */