diff options
author | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-24 12:07:13 +0000 |
---|---|---|
committer | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-24 12:07:13 +0000 |
commit | 415d1b9a7810774124b32b9dc3990c81ba96efaa (patch) | |
tree | 4dd09f8eb18392a620ad92b028d01fbda5d27ee7 /gcc/cp | |
parent | a0792f1ef98b4610cc0a20de07c5f891e4c345a1 (diff) | |
download | gcc-415d1b9a7810774124b32b9dc3990c81ba96efaa.tar.gz |
IPA C++ refactoring 1/N
* cgraph.h (symtab_node):
(void register_symbol (void)): created from symtab_register_node
(void remove (void)): created from symtab_remove_node
(void dump (FILE *f)): created from dump_symtab_node
(void DEBUG_FUNCTION debug (void)): created from debug_symtab_node
(void DEBUG_FUNCTION verify (void)): created from verify_symtab_node
(struct ipa_ref *add_reference (symtab_node *referred_node,
enum ipa_ref_use use_type)): created from add_reference
(struct ipa_ref *add_reference (symtab_node *referred_node,
enum ipa_ref_use use_type, gimple stmt)): created from add_reference
(struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type,
gimple stmt)): created from maybe_add_reference
(bool semantically_equivalent_p (symtab_node *target)): created from
symtab_semantically_equivalent_p
(void remove_from_same_comdat_group (void)): created from
remove_from_same_comdat_group
(void add_to_same_comdat_group (symtab_node *old_node)): created from
symtab_add_to_same_comdat_group
(void dissolve_same_comdat_group_list (void)): created from
symtab_dissolve_same_comdat_group_list
(bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p
(symtab_node *ultimate_alias_target (enum availability *avail = NULL)):
created from symtab_alias_ultimate_target
(inline symtab_node *next_defined_symbol (void)): created from
symtab_next_defined_symbol
(bool resolve_alias (symtab_node *target)): created from
symtab_resolve_alias
(bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *),
void *data, bool include_overwrite)): created from symtab_for_node_and_aliases
(symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias
(inline symtab_node *get_alias_target (void)): created from symtab_alias_target
(void set_section (const char *section)): created from set_section_1
(enum availability get_availability (void)): created from symtab_node_availability
(void make_decl_local (void)): created from symtab_make_decl_local
(bool real_symbol_p (void)): created from symtab_read_node
(can_be_discarded_p (void)): created from symtab_can_be_discarded
(inline bool comdat_local_p (void)): created from symtab_comdat_local_p
(inline bool in_same_comdat_group_p (symtab_node *target)): created from
symtab_in_same_comdat_p;
(bool address_taken_from_non_vtable_p (void)): created from
address_taken_from_non_vtable_p
(static inline symtab_node *get (const_tree decl)): created from symtab_get_node
(static void dump_table (FILE *)): created from dump_symtab
(static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab
(static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab
(static bool used_from_object_file_p_worker (symtab_node *node)): created from
symtab_used_from_object_file_p
(void dump_base (FILE *)): created from dump_symtab_base
(bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base
(void unregister (void)): created from symtab_unregister_node
(struct symbol_priority_map *priority_info (void)): created from symtab_priority_info
(static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section
(static bool noninterposable_alias (symtab_node *node, void *data)): created from
symtab_nonoverwritable_alias_1
* cgraph.h (cgraph_node):
(bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)):
created from cgraph_remove_node_and_inline_clones
(void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references
(void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt,
bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones
(cgraph_node *function_symbol (enum availability *avail = NULL)):
created from cgraph_function_node
(cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original,
vec<cgraph_edge *> redirect_callers, bool call_duplication_hook,
struct cgraph_node *new_inlined_to, bitmap args_to_skip)):
created from cgraph_create_clone
(cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers,
vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)):
created from cgraph_create_virtual_clone
(cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node
(cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers,
bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning
(cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers,
vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return,
bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)):
created from cgraph_function_version_info
(struct cgraph_function_version_info *insert_new_function_version (void)):
created from insert_new_cgraph_node_version
(struct cgraph_function_version_info *function_version (void)): created from
get_cgraph_node_version
(void analyze (void)): created from analyze_function
(cgraph_node * create_thunk (tree alias, tree, bool this_adjusting,
HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset,
tree real_alias) cgraph_add_thunk
(inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target
(cgraph_node *ultimate_alias_target (availability *availability = NULL)):
created from cgraph_function_or_thunk_node
(bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)):
created from expand_thunk
(void reset (void)): created from cgraph_reset_node
(void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper
(void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node
(void remove (void)): created from cgraph_remove_node
(void dump (FILE *f)): created from dump_cgraph_node
(void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node
(bool get_body (void)): created from cgraph_get_body
(void release_body (void)): created from cgraph_release_function_body
(void unnest (void)): created from cgraph_unnest_node
(void make_local (void)): created from cgraph_make_node_local
(void mark_address_taken (void)): created from cgraph_mark_address_taken_node
(struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt,
gcov_type count, int freq)): created from cgraph_create_edge
(struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags,
gcov_type count, int freq)): created from cgraph_create_indirect_edge
(void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt,
gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)):
created from cgraph_create_edge_including_clones
(cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge
(vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node
(void remove_callers (void)): created from cgraph_node_remove_callers
(void remove_callees (void)): created from cgraph_node_remove_callees
(enum availability get_availability (void)): created from cgraph_function_body_availability
(void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag
(void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag
(void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag
(void call_duplication_hooks (cgraph_node *node2)): created from
cgraph_call_node_duplication_hooks
(bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *),
void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases
(bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data),
void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases
(void call_function_insertion_hooks (void)):
created from cgraph_call_function_insertion_hooks
(inline void mark_force_output (void)): created from cgraph_mark_force_output_node
(bool local_p (void)): created from cgraph_local_node
(bool can_be_local_p (void)): created from cgraph_node_can_be_local_p
(bool cannot_return_p (void)): created from cgraph_node_cannot_return
(bool only_called_directly_p (void)): created from cgraph_only_called_directly_p
(inline bool only_called_directly_or_aliased_p (void)):
created from cgraph_only_called_directly_or_aliased_p
(bool will_be_removed_from_program_if_no_direct_calls_p (void)):
created from cgraph_will_be_removed_from_program_if_no_direct_calls
(bool can_remove_if_no_direct_calls_and_refs_p (void)):
created from cgraph_can_remove_if_no_direct_calls_and_refs_p
(bool can_remove_if_no_direct_calls_p (void)):
created from cgraph_can_remove_if_no_direct_calls_p
(inline bool has_gimple_body_p (void)):
created from cgraph_function_with_gimple_body_p
(bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p
(static void dump_cgraph (FILE *f)): created from dump_cgraph
(static inline void debug_cgraph (void)): created from debug_cgraph
(static void record_function_versions (tree decl1, tree decl2)):
created from record_function_versions
(static void delete_function_version (tree decl)):
created from delete_function_version
(static void add_new_function (tree fndecl, bool lowered)):
created from cgraph_add_new_function
(static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node
(static cgraph_node * create (tree decl)): created from cgraph_create_node
(static cgraph_node * create_empty (void)): created from cgraph_create_empty_node
(static cgraph_node * get_create (tree)): created from cgraph_get_create_node
(static cgraph_node *get_for_asmname (tree asmname)):
created from cgraph_node_for_asm
(static cgraph_node * create_same_body_alias (tree alias, tree decl)):
created from cgraph_same_body_alias
(static bool used_from_object_file_p_worker (cgraph_node *node,
void *): new function
(static bool non_local_p (cgraph_node *node, void *)):
created from cgraph_non_local_node_p_1
(static void DEBUG_FUNCTION verify_cgraph_nodes (void)):
created from verify_cgraph
(static bool make_local (cgraph_node *node, void *)):
created from cgraph_make_node_local
(static cgraph_node *create_alias (tree alias, tree target)):
created from cgraph_create_function_alias
(static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee,
gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)):
created from cgraph_create_edge_1
* cgraph.h (varpool_node):
(void remove (void)): created from varpool_remove_node
(void dump (FILE *f)): created from dump_varpool_node
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212982 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/call.c | 4 | ||||
-rw-r--r-- | gcc/cp/class.c | 2 | ||||
-rw-r--r-- | gcc/cp/decl.c | 17 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 28 | ||||
-rw-r--r-- | gcc/cp/lambda.c | 5 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 4 | ||||
-rw-r--r-- | gcc/cp/method.c | 25 | ||||
-rw-r--r-- | gcc/cp/optimize.c | 37 | ||||
-rw-r--r-- | gcc/cp/tree.c | 2 | ||||
-rw-r--r-- | gcc/cp/vtable-class-hierarchy.c | 4 |
10 files changed, 63 insertions, 65 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 61e2769807b..4d37c65209f 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -6848,13 +6848,13 @@ mark_versions_used (tree fn) gcc_assert (TREE_CODE (fn) == FUNCTION_DECL); - node = cgraph_get_node (fn); + node = cgraph_node::get (fn); if (node == NULL) return; gcc_assert (node->dispatcher_function); - node_v = get_cgraph_node_version (node); + node_v = node->function_version (); if (node_v == NULL) return; diff --git a/gcc/cp/class.c b/gcc/cp/class.c index e4523c7b1f6..0f611e10a6f 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -1147,7 +1147,7 @@ add_method (tree type, tree method, tree using_decl) if (DECL_ASSEMBLER_NAME_SET_P (method)) mangle_decl (method); } - record_function_versions (fn, method); + cgraph_node::record_function_versions (fn, method); continue; } if (DECL_INHERITED_CTOR_BASE (method)) diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 87249a034a6..150c74e2ef7 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1072,7 +1072,7 @@ decls_match (tree newdecl, tree olddecl) if (DECL_ASSEMBLER_NAME_SET_P (olddecl)) mangle_decl (olddecl); } - record_function_versions (olddecl, newdecl); + cgraph_node::record_function_versions (olddecl, newdecl); return 0; } } @@ -2074,10 +2074,11 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) { struct symtab_node *symbol; if (TREE_CODE (olddecl) == FUNCTION_DECL) - symbol = cgraph_get_create_node (newdecl); + symbol = cgraph_node::get_create (newdecl); else symbol = varpool_node_for_decl (newdecl); - symbol->set_comdat_group (symtab_get_node (olddecl)->get_comdat_group ()); + symbol->set_comdat_group (symtab_node::get + (olddecl)->get_comdat_group ()); } DECL_DEFER_OUTPUT (newdecl) |= DECL_DEFER_OUTPUT (olddecl); @@ -2382,13 +2383,13 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) DECL_FUNCTION_VERSIONED (newdecl) = 1; /* newdecl will be purged after copying to olddecl and is no longer a version. */ - delete_function_version (newdecl); + cgraph_node::delete_function_version (newdecl); } if (TREE_CODE (newdecl) == FUNCTION_DECL) { int function_size; - struct symtab_node *snode = symtab_get_node (olddecl); + struct symtab_node *snode = symtab_node::get (olddecl); function_size = sizeof (struct tree_decl_common); @@ -2450,7 +2451,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) if (TREE_CODE (olddecl) == VAR_DECL && (TREE_STATIC (olddecl) || TREE_PUBLIC (olddecl) || DECL_EXTERNAL (olddecl))) - snode = symtab_get_node (olddecl); + snode = symtab_node::get (olddecl); memcpy ((char *) olddecl + sizeof (struct tree_decl_common), (char *) newdecl + sizeof (struct tree_decl_common), size - sizeof (struct tree_decl_common) @@ -2502,9 +2503,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) if (TREE_CODE (newdecl) == FUNCTION_DECL || TREE_CODE (newdecl) == VAR_DECL) { - struct symtab_node *snode = symtab_get_node (newdecl); + struct symtab_node *snode = symtab_node::get (newdecl); if (snode) - symtab_remove_node (snode); + snode->remove (); } ggc_free (newdecl); diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 83a07e64d72..90244efab45 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1928,7 +1928,7 @@ mark_needed (tree decl) If we know a method will be emitted in other TU and no new functions can be marked reachable, just use the external definition. */ - struct cgraph_node *node = cgraph_get_create_node (decl); + struct cgraph_node *node = cgraph_node::get_create (decl); node->forced_by_abi = true; } else if (TREE_CODE (decl) == VAR_DECL) @@ -2055,7 +2055,7 @@ maybe_emit_vtables (tree ctype) { current = varpool_node_for_decl (vtbl); if (last) - symtab_add_to_same_comdat_group (current, last); + current->add_to_same_comdat_group (last); last = current; } } @@ -2125,7 +2125,7 @@ constrain_visibility (tree decl, int visibility, bool tmpl) if (TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL) { - struct symtab_node *snode = symtab_get_node (decl); + struct symtab_node *snode = symtab_node::get (decl); if (snode) snode->set_comdat_group (NULL); @@ -4252,8 +4252,8 @@ handle_tls_init (void) if (single_init_fn == NULL_TREE) continue; cgraph_node *alias - = cgraph_same_body_alias (cgraph_get_create_node (fn), - single_init_fn, fn); + = cgraph_node::get_create (fn)->create_same_body_alias + (single_init_fn, fn); gcc_assert (alias != NULL); } #endif @@ -4521,21 +4521,21 @@ cp_write_global_declarations (void) { struct cgraph_node *node, *next; - node = cgraph_get_node (decl); + node = cgraph_node::get (decl); if (node->cpp_implicit_alias) - node = cgraph_alias_target (node); + node = node->get_alias_target (); - cgraph_for_node_and_aliases (node, clear_decl_external, - NULL, true); + node->call_for_symbol_thunks_and_aliases (clear_decl_external, + NULL, true); /* If we mark !DECL_EXTERNAL one of the symbols in some comdat group, we need to mark all symbols in the same comdat group that way. */ if (node->same_comdat_group) - for (next = cgraph (node->same_comdat_group); + for (next = dyn_cast<cgraph_node *> (node->same_comdat_group); next != node; - next = cgraph (next->same_comdat_group)) - cgraph_for_node_and_aliases (next, clear_decl_external, - NULL, true); + next = dyn_cast<cgraph_node *> (next->same_comdat_group)) + next->call_for_symbol_thunks_and_aliases (clear_decl_external, + NULL, true); } /* If we're going to need to write this function out, and @@ -4545,7 +4545,7 @@ cp_write_global_declarations (void) if (!DECL_EXTERNAL (decl) && decl_needed_p (decl) && !TREE_ASM_WRITTEN (decl) - && !cgraph_get_node (decl)->definition) + && !cgraph_node::get (decl)->definition) { /* We will output the function; no longer consider it in this loop. */ diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index e72682c9487..169f438e562 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -1038,9 +1038,8 @@ maybe_add_lambda_conv_op (tree type) if (DECL_ONE_ONLY (statfn)) { /* Put the thunk in the same comdat group as the call op. */ - symtab_add_to_same_comdat_group - (cgraph_get_create_node (statfn), - cgraph_get_create_node (callop)); + cgraph_node::get_create (statfn)->add_to_same_comdat_group + (cgraph_node::get_create (callop)); } tree body = begin_function_body (); tree compound_stmt = begin_compound_stmt (0); diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 02c05d47747..8983e0dfa69 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -3487,8 +3487,8 @@ mangle_decl (const tree decl) if (TREE_CODE (decl) == FUNCTION_DECL) { /* Don't create an alias to an unreferenced function. */ - if (struct cgraph_node *n = cgraph_get_node (decl)) - cgraph_same_body_alias (n, alias, decl); + if (struct cgraph_node *n = cgraph_node::get (decl)) + n->create_same_body_alias (alias, decl); } else varpool_extra_name_alias (alias, decl); diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 1fa4be8d552..e5fa0c1b9da 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -260,9 +260,9 @@ make_alias_for_thunk (tree function) if (!flag_syntax_only) { struct cgraph_node *funcn, *aliasn; - funcn = cgraph_get_node (function); + funcn = cgraph_node::get (function); gcc_checking_assert (funcn); - aliasn = cgraph_same_body_alias (funcn, alias, function); + aliasn = cgraph_node::create_same_body_alias (alias, function); DECL_ASSEMBLER_NAME (function); gcc_assert (aliasn != NULL); } @@ -359,13 +359,13 @@ use_thunk (tree thunk_fndecl, bool emit_p) tree fn = function; struct symtab_node *symbol; - if ((symbol = symtab_get_node (function)) + if ((symbol = symtab_node::get (function)) && symbol->alias) { if (symbol->analyzed) - fn = symtab_alias_ultimate_target (symtab_get_node (function))->decl; + fn = symtab_node::get (function)->ultimate_alias_target ()->decl; else - fn = symtab_get_node (function)->alias_target; + fn = symtab_node::get (function)->alias_target; } resolve_unique_section (fn, 0, flag_function_sections); @@ -375,8 +375,8 @@ use_thunk (tree thunk_fndecl, bool emit_p) /* Output the thunk into the same section as function. */ set_decl_section_name (thunk_fndecl, DECL_SECTION_NAME (fn)); - symtab_get_node (thunk_fndecl)->implicit_section - = symtab_get_node (fn)->implicit_section; + symtab_node::get (thunk_fndecl)->implicit_section + = symtab_node::get (fn)->implicit_section; } } @@ -395,14 +395,13 @@ use_thunk (tree thunk_fndecl, bool emit_p) a = nreverse (t); DECL_ARGUMENTS (thunk_fndecl) = a; TREE_ASM_WRITTEN (thunk_fndecl) = 1; - funcn = cgraph_get_node (function); + funcn = cgraph_node::get (function); gcc_checking_assert (funcn); - thunk_node = cgraph_add_thunk (funcn, thunk_fndecl, function, - this_adjusting, fixed_offset, virtual_value, - virtual_offset, alias); + thunk_node = funcn->create_thunk (thunk_fndecl, function, + this_adjusting, fixed_offset, virtual_value, + virtual_offset, alias); if (DECL_ONE_ONLY (function)) - symtab_add_to_same_comdat_group (thunk_node, - funcn); + thunk_node->add_to_same_comdat_group (funcn); if (!this_adjusting || !targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset, diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index c16e163826e..3cd804780eb 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -191,7 +191,7 @@ cdtor_comdat_group (tree complete, tree base) diff_seen = true; } grp_name[idx] = '\0'; - gcc_assert (diff_seen || symtab_get_node (complete)->alias); + gcc_assert (diff_seen || symtab_node::get (complete)->alias); return get_identifier (grp_name); } @@ -287,16 +287,16 @@ maybe_thunk_body (tree fn, bool force) else if (HAVE_COMDAT_GROUP) { tree comdat_group = cdtor_comdat_group (fns[1], fns[0]); - cgraph_get_create_node (fns[0])->set_comdat_group (comdat_group); - symtab_add_to_same_comdat_group (cgraph_get_create_node (fns[1]), - cgraph_get_create_node (fns[0])); - symtab_add_to_same_comdat_group (symtab_get_node (fn), - symtab_get_node (fns[0])); + cgraph_node::get_create (fns[0])->set_comdat_group (comdat_group); + cgraph_node::get_create (fns[1])->add_to_same_comdat_group + (cgraph_node::get_create (fns[0])); + symtab_node::get (fn)->add_to_same_comdat_group + (symtab_node::get (fns[0])); if (fns[2]) /* If *[CD][12]* dtors go into the *[CD]5* comdat group and dtor is virtual, it goes into the same comdat group as well. */ - symtab_add_to_same_comdat_group (cgraph_get_create_node (fns[2]), - symtab_get_node (fns[0])); + cgraph_node::get_create (fns[2])->add_to_same_comdat_group + (symtab_node::get (fns[0])); TREE_PUBLIC (fn) = false; DECL_EXTERNAL (fn) = false; DECL_INTERFACE_KNOWN (fn) = true; @@ -475,7 +475,7 @@ maybe_clone_body (tree fn) name of fn was corrupted by write_mangled_name by adding *INTERNAL* to it. By doing so, it also corrupted the comdat group. */ if (DECL_ONE_ONLY (fn)) - cgraph_get_create_node (clone)->set_comdat_group (cxx_comdat_group (clone)); + cgraph_node::get_create (clone)->set_comdat_group (cxx_comdat_group (clone)); DECL_USE_TEMPLATE (clone) = DECL_USE_TEMPLATE (fn); DECL_EXTERNAL (clone) = DECL_EXTERNAL (fn); DECL_INTERFACE_KNOWN (clone) = DECL_INTERFACE_KNOWN (fn); @@ -542,8 +542,8 @@ maybe_clone_body (tree fn) if (can_alias && fns[0] && idx == 1 - && cgraph_same_body_alias (cgraph_get_create_node (fns[0]), - clone, fns[0])) + && cgraph_node::get_create (fns[0])->create_same_body_alias + (clone, fns[0])) { alias = true; if (DECL_ONE_ONLY (fns[0])) @@ -552,11 +552,11 @@ maybe_clone_body (tree fn) into the same, *[CD]5* comdat group instead of *[CD][12]*. */ comdat_group = cdtor_comdat_group (fns[1], fns[0]); - cgraph_get_create_node (fns[0])->set_comdat_group (comdat_group); - if (symtab_get_node (clone)->same_comdat_group) - symtab_remove_from_same_comdat_group (symtab_get_node (clone)); - symtab_add_to_same_comdat_group (symtab_get_node (clone), - symtab_get_node (fns[0])); + cgraph_node::get_create (fns[0])->set_comdat_group (comdat_group); + if (symtab_node::get (clone)->same_comdat_group) + symtab_node::get (clone)->remove_from_same_comdat_group (); + symtab_node::get (clone)->add_to_same_comdat_group + (symtab_node::get (fns[0])); } } @@ -568,9 +568,8 @@ maybe_clone_body (tree fn) /* If *[CD][12]* dtors go into the *[CD]5* comdat group and dtor is virtual, it goes into the same comdat group as well. */ if (comdat_group) - symtab_add_to_same_comdat_group - (cgraph_get_create_node (clone), - symtab_get_node (fns[0])); + cgraph_node::get_create (clone)->add_to_same_comdat_group + (symtab_node::get (fns[0])); } else if (alias) /* No need to populate body. */ ; diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index e7823663f5e..f6c5693df5f 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -4031,7 +4031,7 @@ cp_fix_function_decl_p (tree decl) && !DECL_THUNK_P (decl) && !DECL_EXTERNAL (decl)) { - struct cgraph_node *node = cgraph_get_node (decl); + struct cgraph_node *node = cgraph_node::get (decl); /* Don't fix same_body aliases. Although they don't have their own CFG, they share it with what they alias to. */ diff --git a/gcc/cp/vtable-class-hierarchy.c b/gcc/cp/vtable-class-hierarchy.c index f69e6bb3c95..09e6730b37c 100644 --- a/gcc/cp/vtable-class-hierarchy.c +++ b/gcc/cp/vtable-class-hierarchy.c @@ -1186,7 +1186,7 @@ vtv_generate_init_routine (void) DECL_STATIC_CONSTRUCTOR (vtv_fndecl) = 0; gimplify_function_tree (vtv_fndecl); - cgraph_add_new_function (vtv_fndecl, false); + cgraph_node::add_new_function (vtv_fndecl, false); cgraph_process_new_functions (); @@ -1248,7 +1248,7 @@ vtable_find_or_create_map_decl (tree base_type) we can find and protect them. */ set_decl_section_name (var_decl, ".vtable_map_vars"); - symtab_get_node (var_decl)->implicit_section = true; + symtab_node::get (var_decl)->implicit_section = true; DECL_INITIAL (var_decl) = initial_value; comdat_linkage (var_decl); |