/* True when the function has been originally extern inline, but it is
redefined now. */
unsigned redefined_extern_inline : 1;
+
+ /* True if the function may enter serial irrevocable mode. */
+ unsigned tm_may_enter_irr : 1;
};
/* Information about the function that needs to be computed globally
unsigned only_called_at_startup : 1;
/* True when function can only be called at startup (from static dtor). */
unsigned only_called_at_exit : 1;
+ /* True when function is the transactional clone of a function which
+ is called only from inside transactions. */
+ /* ?? We should be able to remove this. We have enough bits in
+ cgraph to calculate it. */
+ unsigned tm_clone : 1;
};
typedef struct cgraph_node *cgraph_node_ptr;
int, bool, VEC(cgraph_edge_p,heap) *,
bool);
struct cgraph_node *cgraph_create_function_alias (tree, tree);
+void cgraph_call_node_duplication_hooks (struct cgraph_node *node1,
+ struct cgraph_node *node2);
void cgraph_redirect_edge_callee (struct cgraph_edge *, struct cgraph_node *);
void cgraph_make_edge_direct (struct cgraph_edge *, 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_copy_node_for_versioning (struct cgraph_node *,
+ tree, VEC(cgraph_edge_p,heap)*, bitmap);
struct cgraph_node *cgraph_function_versioning (struct cgraph_node *,
VEC(cgraph_edge_p,heap)*,
VEC(ipa_replace_map_p,gc)*,
- bitmap, bitmap, basic_block,
- const char *);
-void tree_function_versioning (tree, tree, VEC (ipa_replace_map_p,gc)*, bool, bitmap,
- bitmap, basic_block);
+ bitmap, bool, bitmap,
+ basic_block, const char *);
+void tree_function_versioning (tree, tree, VEC (ipa_replace_map_p,gc)*,
+ bool, bitmap, bool, bitmap, basic_block);
void record_references_in_initializer (tree, bool);
bool cgraph_process_new_functions (void);
void cgraph_process_same_body_aliases (void);
void free_varpool_node_set (varpool_node_set);
void ipa_discover_readonly_nonaddressable_vars (void);
bool cgraph_comdat_can_be_unshared_p (struct cgraph_node *);
+bool varpool_externally_visible_p (struct varpool_node *, bool);
/* In predict.c */
bool cgraph_maybe_hot_edge_p (struct cgraph_edge *e);
bool varpool_for_node_and_aliases (struct varpool_node *,
bool (*) (struct varpool_node *, void *),
void *, bool);
+void varpool_add_new_variable (tree);
/* Walk all reachable static variables. */
#define FOR_EACH_STATIC_VARIABLE(node) \
return NULL;
}
-/* Return next reachable static variable with initializer after NODE. */
+/* Return next function with body defined after NODE. */
static inline struct cgraph_node *
cgraph_next_defined_function (struct cgraph_node *node)
{
gcc_assert (!node->global.inlined_to);
return (!node->needed && !node->address_taken
&& !node->reachable_from_other_partition
+ && !DECL_VIRTUAL_P (node->decl)
&& !DECL_STATIC_CONSTRUCTOR (node->decl)
&& !DECL_STATIC_DESTRUCTOR (node->decl)
&& !node->local.externally_visible);
static inline bool
varpool_can_remove_if_no_refs (struct varpool_node *node)
{
+ if (DECL_EXTERNAL (node->decl))
+ return true;
return (!node->force_output && !node->used_from_other_partition
- && (flag_toplevel_reorder || DECL_COMDAT (node->decl)
- || DECL_ARTIFICIAL (node->decl))
- && (DECL_COMDAT (node->decl) || !node->externally_visible));
+ && ((DECL_COMDAT (node->decl)
+ && !varpool_used_from_object_file_p (node))
+ || (flag_toplevel_reorder && !node->externally_visible)
+ || DECL_HAS_VALUE_EXPR_P (node->decl)));
}
/* Return true when all references to VNODE must be visible in ipa_ref_list.
else
return e->caller->decl == callee->decl;
}
+
+/* Return true if the TM_CLONE bit is set for a given FNDECL. */
+static inline bool
+decl_is_tm_clone (const_tree fndecl)
+{
+ struct cgraph_node *n = cgraph_get_node (fndecl);
+ if (n)
+ return n->tm_clone;
+ return false;
+}
#endif /* GCC_CGRAPH_H */