#ifndef GCC_CGRAPH_H
#define GCC_CGRAPH_H
+#include "plugin-api.h"
#include "vec.h"
#include "tree.h"
#include "basic-block.h"
/* 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;
/* 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;
/* 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
/* 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;
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. */
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;
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);
(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;
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) \