/* Callgraph handling code.
- Copyright (C) 2003-2013 Free Software Foundation, Inc.
+ Copyright (C) 2003-2014 Free Software Foundation, Inc.
Contributed by Jan Hubicka
This file is part of GCC.
/* Set when function is visible by other units. */
unsigned externally_visible : 1;
- /* The symbol will be assumed to be used in an invisiable way (like
+ /* The symbol will be assumed to be used in an invisible way (like
by an toplevel asm statement). */
unsigned force_output : 1;
/* Like FORCE_OUTPUT, but in the case it is ABI requiring the symbol to be
unsigned forced_by_abi : 1;
/* True when the name is known to be unique and thus it does not need mangling. */
unsigned unique_name : 1;
-
+ /* True when body and other characteristics have been removed by
+ symtab_remove_unreachable_nodes. */
+ unsigned body_removed : 1;
/*** WHOPR Partitioning flags.
These flags are used at ltrans stage when only part of the callgraph is
unsigned index;
};
-#define DEFCIFCODE(code, string) CIF_ ## code,
+#define DEFCIFCODE(code, type, string) CIF_ ## code,
/* Reasons for inlining failures. */
enum cgraph_inline_failed_t {
#include "cif-code.def"
CIF_N_REASONS
};
+enum cgraph_inline_failed_type_t
+{
+ CIF_FINAL_NORMAL = 0,
+ CIF_FINAL_ERROR
+};
+
/* Structure containing additional information about an indirect call. */
struct GTY(()) cgraph_indirect_call_info
extern GTY(()) int symtab_order;
extern bool cpp_implicit_aliases_done;
+/* Classifcation of symbols WRT partitioning. */
+enum symbol_partitioning_class
+{
+ /* External declarations are ignored by partitioning algorithms and they are
+ added into the boundary later via compute_ltrans_boundary. */
+ SYMBOL_EXTERNAL,
+ /* Partitioned symbols are pur into one of partitions. */
+ SYMBOL_PARTITION,
+ /* Duplicated symbols (such as comdat or constant pool references) are
+ copied into every node needing them via add_symbol_to_partition. */
+ SYMBOL_DUPLICATE
+};
+
+
/* In symtab.c */
void symtab_register_node (symtab_node *);
void symtab_unregister_node (symtab_node *);
symtab_node *symtab_nonoverwritable_alias (symtab_node *);
enum availability symtab_node_availability (symtab_node *);
bool symtab_semantically_equivalent_p (symtab_node *, symtab_node *);
+enum symbol_partitioning_class symtab_get_symbol_partitioning_class (symtab_node *);
/* In cgraph.c */
void dump_cgraph (FILE *);
enum availability cgraph_function_body_availability (struct cgraph_node *);
void cgraph_add_new_function (tree, bool);
const char* cgraph_inline_failed_string (cgraph_inline_failed_t);
+cgraph_inline_failed_type_t cgraph_inline_failed_type (cgraph_inline_failed_t);
void cgraph_set_nothrow_flag (struct cgraph_node *, bool);
void cgraph_set_const_flag (struct cgraph_node *, bool, bool);
{
varpool_node *n;
- n = dyn_cast <varpool_node> (symtab_alias_ultimate_target (node,
- availability));
+ if (node)
+ n = dyn_cast <varpool_node> (symtab_alias_ultimate_target (node,
+ availability));
+ else
+ n = NULL;
+
if (!n && availability)
*availability = AVAIL_NOT_AVAILABLE;
return n;