diff options
author | Jan Hubicka <jh@suse.cz> | 2010-09-24 23:47:59 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-09-24 21:47:59 +0000 |
commit | 051f8cc6c71cf29bda39effeb4bc6b0ff2e36d65 (patch) | |
tree | 83ac2cd6e9618944ed45f4905c495d5b42344809 /gcc/cgraph.h | |
parent | 5c255b57b25e4847b8e556c4b6450e6f559329ff (diff) | |
download | gcc-051f8cc6c71cf29bda39effeb4bc6b0ff2e36d65.zip gcc-051f8cc6c71cf29bda39effeb4bc6b0ff2e36d65.tar.gz gcc-051f8cc6c71cf29bda39effeb4bc6b0ff2e36d65.tar.bz2 |
lto-symtab.c (lto_symtab_entry_def): Add guessed field.
* lto-symtab.c (lto_symtab_entry_def): Add guessed field.
(lto_symtab_resolve_symbols): Set it.
(lto_symtab_merge_decls_1): Do not compute used_from_object_file;
store resolution field in cgraph/varpool.
* cgraph.c (cgraph_same_body_alias, cgraph_add_thunk): Return node.
(cgraph_get_node_or_alias, cgraph_get_node_or_alias): Constify.
(cgraph_dump_node): Drop used_from_object_file.
(cgraph_clone_node, cgraph_create_virtual_clone): Likewise.
(cgraph_function_body_availability): Use decl_replaceable_p.
(cgraph_make_node_local): Set resolution to LDPR_PREVAILING_DEF_IRONLY.
(cgraph_can_remove_if_no_direct_calls_and_refs): Use
cgraph_used_from_object_file_p.
(cgraph_will_be_removed_from_program_if_no_direct_calls): Use
cgraph_used_from_object_file_p.
(resolution_used_from_other_file_p): New functoin.
(cgraph_used_from_object_file_p): New predicate.
* cgraph.h: Include plugin-api.h
(struct cgraph_local_info): Remove used_from_object_file.
(struct cgraph_node): Add resolution field.
(struct varpool_node): Likewise; remove used_from_object_file;
reove const_value_known.
(cgraph_get_node, cgraph_get_node_or_alias, cgraph_node,
cgraph_same_body_alias, cgraph_add_thunk): Update prototypes.
(resolution_used_from_other_file_p, cgraph_used_from_object_file_p,
varpool_used_from_object_file_p): Declare.
(varpool_get_node, varpool_extra_name_alias): Update prototype.
* tree.h (DECL_REPLACEABLE_P): Remove.
(decl_replaceable_p, decl_binds_to_current_def_p): Declare.
* final.c (rest_of_clean_state): Use decl_binds_to_current_def_p.
* lto-cgraph.c (lto_output_node, lto_output_varpool_node,
input_overwrite_node, input_node, input_varpool_node): Stream
resolution.
* expr.c (expand_expr_real_1): Use const_value_known_p
* ipa.c (ipa_discover_readonly_nonaddressable_var): Do not set
const_value_known.
(cgraph_externally_visible_p): Use cgraph_used_from_object_file_p.
(function_and_variable_visibility): Set resolution for local vars
and functions.
use varpool_used_from_object_file_p.
* varasm.c (resolution_to_local_definition_p, resolution_local_p): New
static functions.
(default_binds_local_p_1): Use resolutoin info.
(decl_binds_to_current_def_p, decl_replaceable_p): New functions.
* varpool.c (varpool_get_node): Constify.
(const_value_known_p): Do not use vnode->const_value_known;
use decl_replaceable_p.
(varpool_finalize_decl): Do not set const_value_known.
(cgraph_variable_initializer_availability): Use decl_replaceable_p
(varpool_extra_name_alias): Return new node.
(varpool_used_from_object_file_p): New function.
* decl.c (finish_function): Use decl_replaceable_p
* method.c (make_alias_for_thunk): Update call of cgraph_same_body_alias.
* lto.c (lto_promote_cross_file_statics): Use const_value_known_p.
From-SVN: r164610
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index ec90894..330c883 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_CGRAPH_H #define GCC_CGRAPH_H +#include "plugin-api.h" #include "vec.h" #include "tree.h" #include "basic-block.h" @@ -101,9 +102,6 @@ struct GTY(()) cgraph_local_info { /* Set when function is visible by other units. */ unsigned externally_visible : 1; - - /* Set when resolver determines that function is visible by other units. */ - unsigned used_from_object_file : 1; /* Set once it has been finalized so we consider it to be output. */ unsigned finalized : 1; @@ -259,6 +257,7 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) cgraph_node { /* unique id for profiling. pid is not suitable because of different number of cfg nodes with -fprofile-generate and -fprofile-use */ int pid; + enum ld_plugin_symbol_resolution resolution; /* Set when function must be output for some reason. The primary use of this flag is to mark functions needed to be output for @@ -476,6 +475,7 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.prev"))) varpool_node { PTR GTY ((skip)) aux; /* Ordering of all cgraph nodes. */ int order; + enum ld_plugin_symbol_resolution resolution; /* Set when function must be output - it is externally visible or its address is taken. */ @@ -492,8 +492,6 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.prev"))) varpool_node { unsigned output : 1; /* Set when function is visible by other units. */ unsigned externally_visible : 1; - /* Set when resolver determines that variable is visible by other units. */ - unsigned used_from_object_file : 1; /* Set for aliases once they got through assemble_alias. Also set for extra name aliases in varpool_extra_name_alias. */ unsigned alias : 1; @@ -503,8 +501,6 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.prev"))) varpool_node { During WPA output it is used to mark nodes that are present in multiple partitions. */ unsigned in_other_partition : 1; - /* True when variable is constant and its value is known. */ - unsigned int const_value_known : 1; }; /* Every top level asm statement is put into a cgraph_asm_node. */ @@ -561,11 +557,12 @@ struct cgraph_edge *cgraph_create_edge (struct cgraph_node *, gimple, gcov_type, int, int); struct cgraph_edge *cgraph_create_indirect_edge (struct cgraph_node *, gimple, int, gcov_type, int, int); -struct cgraph_node * cgraph_get_node (tree); -struct cgraph_node * cgraph_get_node_or_alias (tree); -struct cgraph_node *cgraph_node (tree); -bool cgraph_same_body_alias (tree, tree); -void cgraph_add_thunk (tree, tree, bool, HOST_WIDE_INT, HOST_WIDE_INT, tree, tree); +struct cgraph_node * cgraph_get_node (const_tree); +struct cgraph_node * cgraph_get_node_or_alias (const_tree); +struct cgraph_node * cgraph_node (tree); +struct cgraph_node * cgraph_same_body_alias (tree, tree); +struct cgraph_node * cgraph_add_thunk (tree, tree, bool, HOST_WIDE_INT, + HOST_WIDE_INT, tree, tree); void cgraph_remove_same_body_alias (struct cgraph_node *); struct cgraph_node *cgraph_node_for_asm (tree); struct cgraph_edge *cgraph_edge (struct cgraph_node *, gimple); @@ -614,6 +611,9 @@ bool cgraph_will_be_removed_from_program_if_no_direct_calls (struct cgraph_node *node); bool cgraph_can_remove_if_no_direct_calls_and_refs_p (struct cgraph_node *node); +bool resolution_used_from_other_file_p (enum ld_plugin_symbol_resolution resolution); +bool cgraph_used_from_object_file_p (struct cgraph_node *node); +bool varpool_used_from_object_file_p (struct varpool_node *node); /* In cgraphunit.c */ extern FILE *cgraph_dump_file; @@ -718,14 +718,14 @@ void cgraph_make_node_local (struct cgraph_node *); bool cgraph_node_can_be_local_p (struct cgraph_node *); -struct varpool_node * varpool_get_node (tree decl); +struct varpool_node * varpool_get_node (const_tree decl); void varpool_remove_node (struct varpool_node *node); bool varpool_assemble_pending_decls (void); bool varpool_assemble_decl (struct varpool_node *node); bool varpool_analyze_pending_decls (void); void varpool_remove_unreferenced_decls (void); void varpool_empty_needed_queue (void); -bool varpool_extra_name_alias (tree, tree); +struct varpool_node * varpool_extra_name_alias (tree, tree); const char * varpool_node_name (struct varpool_node *node); void varpool_reset_queue (void); bool const_value_known_p (tree); |