#ifndef GCC_CGRAPH_H
#define GCC_CGRAPH_H
#include "tree.h"
#include "basic-block.h"
enum availability
{
AVAIL_UNSET,
AVAIL_NOT_AVAILABLE,
AVAIL_OVERWRITABLE,
AVAIL_AVAILABLE,
AVAIL_LOCAL
};
struct cgraph_local_info GTY(())
{
int self_insns;
unsigned local : 1;
unsigned externally_visible : 1;
unsigned finalized : 1;
unsigned inlinable : 1;
unsigned disregard_inline_limits : 1;
unsigned redefined_extern_inline : 1;
unsigned for_functions_valid : 1;
unsigned vtable_method : 1;
};
struct cgraph_global_info GTY(())
{
struct cgraph_node *inlined_to;
int insns;
int estimated_growth;
bool inlined;
};
struct cgraph_rtl_info GTY(())
{
int preferred_incoming_stack_boundary;
};
struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous")))
{
tree decl;
struct cgraph_edge *callees;
struct cgraph_edge *callers;
struct cgraph_node *next;
struct cgraph_node *previous;
struct cgraph_node *origin;
struct cgraph_node *nested;
struct cgraph_node *next_nested;
struct cgraph_node *next_needed;
struct cgraph_node *next_clone;
struct cgraph_node *prev_clone;
struct cgraph_node *master_clone;
htab_t GTY((param_is (struct cgraph_edge))) call_site_hash;
PTR GTY ((skip)) aux;
struct cgraph_local_info local;
struct cgraph_global_info global;
struct cgraph_rtl_info rtl;
gcov_type count;
int uid;
int order;
unsigned needed : 1;
unsigned reachable : 1;
unsigned lowered : 1;
unsigned analyzed : 1;
unsigned output : 1;
unsigned alias : 1;
tree inline_decl;
};
struct cgraph_edge GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller")))
{
struct cgraph_node *caller;
struct cgraph_node *callee;
struct cgraph_edge *prev_caller;
struct cgraph_edge *next_caller;
struct cgraph_edge *prev_callee;
struct cgraph_edge *next_callee;
tree call_stmt;
PTR GTY ((skip (""))) aux;
const char *inline_failed;
gcov_type count;
int loop_nest;
};
typedef struct cgraph_edge *cgraph_edge_p;
DEF_VEC_P(cgraph_edge_p);
DEF_VEC_ALLOC_P(cgraph_edge_p,heap);
struct cgraph_varpool_node GTY(())
{
tree decl;
struct cgraph_varpool_node *next;
struct cgraph_varpool_node *next_needed;
int order;
unsigned needed : 1;
unsigned force_output : 1;
unsigned analyzed : 1;
unsigned finalized : 1;
unsigned output : 1;
unsigned externally_visible : 1;
unsigned alias : 1;
};
struct cgraph_asm_node GTY(())
{
struct cgraph_asm_node *next;
tree asm_str;
int order;
};
extern GTY(()) struct cgraph_node *cgraph_nodes;
extern GTY(()) int cgraph_n_nodes;
extern GTY(()) int cgraph_max_uid;
extern bool cgraph_global_info_ready;
extern bool cgraph_function_flags_ready;
extern GTY(()) struct cgraph_node *cgraph_nodes_queue;
extern GTY(()) struct cgraph_node *cgraph_expand_queue;
extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_first_unanalyzed_node;
extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_last_needed_node;
extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes_queue;
extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes;
extern GTY(()) struct cgraph_asm_node *cgraph_asm_nodes;
extern GTY(()) int cgraph_order;
void dump_cgraph (FILE *);
void dump_cgraph_node (FILE *, struct cgraph_node *);
void cgraph_insert_node_to_hashtable (struct cgraph_node *node);
void dump_varpool (FILE *);
void dump_cgraph_varpool_node (FILE *, struct cgraph_varpool_node *);
void cgraph_remove_edge (struct cgraph_edge *);
void cgraph_remove_node (struct cgraph_node *);
void cgraph_node_remove_callees (struct cgraph_node *node);
struct cgraph_edge *cgraph_create_edge (struct cgraph_node *,
struct cgraph_node *,
tree, gcov_type, int);
struct cgraph_node *cgraph_node (tree);
struct cgraph_node *cgraph_node_for_asm (tree asmname);
struct cgraph_edge *cgraph_edge (struct cgraph_node *, tree);
void cgraph_set_call_stmt (struct cgraph_edge *, tree);
struct cgraph_local_info *cgraph_local_info (tree);
struct cgraph_global_info *cgraph_global_info (tree);
struct cgraph_rtl_info *cgraph_rtl_info (tree);
const char * cgraph_node_name (struct cgraph_node *);
struct cgraph_edge * cgraph_clone_edge (struct cgraph_edge *,
struct cgraph_node *,
tree, gcov_type, int, bool);
struct cgraph_node * cgraph_clone_node (struct cgraph_node *, gcov_type,
int, bool);
struct cgraph_varpool_node *cgraph_varpool_node (tree);
struct cgraph_varpool_node *cgraph_varpool_node_for_asm (tree asmname);
void cgraph_varpool_mark_needed_node (struct cgraph_varpool_node *);
void cgraph_varpool_finalize_decl (tree);
void cgraph_redirect_edge_callee (struct cgraph_edge *, struct cgraph_node *);
struct cgraph_asm_node *cgraph_add_asm_node (tree);
bool cgraph_function_possibly_inlined_p (tree);
void cgraph_unnest_node (struct cgraph_node *);
void cgraph_varpool_enqueue_needed_node (struct cgraph_varpool_node *);
void cgraph_varpool_reset_queue (void);
bool decide_is_variable_needed (struct cgraph_varpool_node *, tree);
enum availability cgraph_function_body_availability (struct cgraph_node *);
enum availability cgraph_variable_initializer_availability (struct cgraph_varpool_node *);
bool cgraph_is_master_clone (struct cgraph_node *);
struct cgraph_node *cgraph_master_clone (struct cgraph_node *);
void cgraph_add_new_function (tree);
bool cgraph_assemble_pending_functions (void);
bool cgraph_varpool_assemble_pending_decls (void);
void cgraph_finalize_function (tree, bool);
void cgraph_finalize_compilation_unit (void);
void cgraph_optimize (void);
void cgraph_mark_needed_node (struct cgraph_node *);
void cgraph_mark_reachable_node (struct cgraph_node *);
bool cgraph_inline_p (struct cgraph_edge *, const char **reason);
bool cgraph_preserve_function_body_p (tree);
void verify_cgraph (void);
void verify_cgraph_node (struct cgraph_node *);
void cgraph_build_static_cdtor (char which, tree body, int priority);
void cgraph_reset_static_var_maps (void);
void init_cgraph (void);
struct cgraph_node *cgraph_function_versioning (struct cgraph_node *,
VEC(cgraph_edge_p,heap)*,
varray_type);
void cgraph_analyze_function (struct cgraph_node *);
struct cgraph_node *save_inline_function_body (struct cgraph_node *);
bool cgraph_remove_unreachable_nodes (bool, FILE *);
int cgraph_postorder (struct cgraph_node **);
bool cgraph_decide_inlining_incrementally (struct cgraph_node *, bool);
void cgraph_clone_inlined_nodes (struct cgraph_edge *, bool, bool);
void cgraph_mark_inline_edge (struct cgraph_edge *, bool);
bool cgraph_default_inline_p (struct cgraph_node *, const char **);
#endif