X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fcgraph.h;h=ea95f70bba7599f499c9ad9a27ccac8e2a73b613;hb=e7052c5d28cf585920562f127dc16c35fa6d25fb;hp=f77a280d12f7f435ed66b5f07eea39050a224ae6;hpb=1e3aebecb9ca632bec0e31e580d41bbee3a20083;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/cgraph.h b/gcc/cgraph.h index f77a280d12f..ea95f70bba7 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; @@ -229,11 +227,8 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) cgraph_node { /* For functions with many calls sites it holds map from call expression to the edge to speed up cgraph_edge function. */ htab_t GTY((param_is (struct cgraph_edge))) call_site_hash; -#ifdef ENABLE_CHECKING - /* Declaration node used to be clone of. Used for checking only. - We must skip it or we get references from release checking GGC files. */ - tree GTY ((skip)) former_clone_of; -#endif + /* Declaration node used to be clone of. */ + tree former_clone_of; PTR GTY ((skip)) aux; @@ -259,6 +254,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 @@ -302,6 +298,10 @@ struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) cgraph_node { /* How commonly executed the node is. Initialized during branch probabilities pass. */ ENUM_BITFIELD (node_frequency) frequency : 2; + /* True when function can only be called at startup (from static ctor). */ + unsigned only_called_at_startup : 1; + /* True when function can only be called at startup (from static dtor). */ + unsigned only_called_at_exit : 1; }; typedef struct cgraph_node *cgraph_node_ptr; @@ -476,6 +476,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 +493,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; @@ -559,11 +558,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); @@ -612,6 +612,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; @@ -716,16 +719,17 @@ 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); /* Walk all reachable static variables. */ #define FOR_EACH_STATIC_VARIABLE(node) \