summaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r--gcc/cgraph.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index ae73f075cce..e2becb96d56 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -543,6 +543,7 @@ struct GTY(()) cgraph_thunk_info {
tree alias;
bool this_adjusting;
bool virtual_offset_p;
+ bool add_pointer_bounds_args;
/* Set to true when alias node is thunk. */
bool thunk_p;
};
@@ -1187,6 +1188,13 @@ public:
cgraph_node *prev_sibling_clone;
cgraph_node *clones;
cgraph_node *clone_of;
+ /* If instrumentation_clone is 1 then instrumented_version points
+ to the original function used to make instrumented version.
+ Otherwise points to instrumented version of the function. */
+ cgraph_node *instrumented_version;
+ /* If instrumentation_clone is 1 then orig_decl is the original
+ function declaration. */
+ tree orig_decl;
/* For functions with many calls sites it holds map from call expression
to the edge to speed up cgraph_edge function. */
hash_table<cgraph_edge_hasher> *GTY(()) call_site_hash;
@@ -1249,6 +1257,9 @@ public:
unsigned calls_comdat_local : 1;
/* True if node has been created by merge operation in IPA-ICF. */
unsigned icf_merged: 1;
+ /* True when function is clone created for Pointer Bounds Checker
+ instrumentation. */
+ unsigned instrumentation_clone : 1;
};
/* A cgraph node set is a collection of cgraph nodes. A cgraph node
@@ -1658,6 +1669,10 @@ public:
/* Set when variable is scheduled to be assembled. */
unsigned output : 1;
+ /* Set when variable has statically initialized pointer
+ or is a static bounds variable and needs initalization. */
+ unsigned need_bounds_init : 1;
+
/* Set if the variable is dynamically initialized, except for
function local statics. */
unsigned dynamically_initialized : 1;
@@ -2181,6 +2196,8 @@ symtab_node::get_alias_target (void)
{
ipa_ref *ref = NULL;
iterate_reference (0, ref);
+ if (ref->use == IPA_REF_CHKP)
+ iterate_reference (1, ref);
gcc_checking_assert (ref->use == IPA_REF_ALIAS);
return ref->referred;
}
@@ -2756,4 +2773,17 @@ ipa_polymorphic_call_context::useless_p () const
{
return (!outer_type && !speculative_outer_type);
}
+
+/* Return true if NODE is local. Instrumentation clones are counted as local
+ only when original function is local. */
+
+static inline bool
+cgraph_local_p (cgraph_node *node)
+{
+ if (!node->instrumentation_clone || !node->instrumented_version)
+ return node->local.local;
+
+ return node->local.local && node->instrumented_version->local.local;
+}
+
#endif /* GCC_CGRAPH_H */