static tree d_handle_used_attribute (tree *, tree, tree, int, bool *);
static tree d_handle_visibility_attribute (tree *, tree, tree, int, bool *);
static tree d_handle_no_sanitize_attribute (tree *, tree, tree, int, bool *);
+static tree d_handle_no_split_stack_attribute (tree *, tree, tree, int, bool *);
static tree d_handle_simd_attribute (tree *, tree, tree, int, bool *);
/* Helper to define attribute exclusions. */
d_handle_cold_attribute, attr_cold_hot_exclusions),
ATTR_SPEC ("no_sanitize", 1, -1, true, false, false, false,
d_handle_no_sanitize_attribute, NULL),
+ ATTR_SPEC ("no_split_stack", 0, 0, true, false, false, false,
+ d_handle_no_split_stack_attribute, NULL),
ATTR_SPEC ("register", 1, 1, true, false, false, false,
d_handle_register_attribute, NULL),
ATTR_SPEC ("restrict", 0, 0, true, false, false, false,
return NULL_TREE;
}
+/* Handle a "no_split_stack" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+d_handle_no_split_stack_attribute (tree *node, tree name, tree, int,
+ bool *no_add_attrs)
+{
+ if (TREE_CODE (*node) != FUNCTION_DECL)
+ {
+ error_at (DECL_SOURCE_LOCATION (*node),
+ "%qE attribute applies only to functions", name);
+ *no_add_attrs = true;
+ }
+
+ return NULL_TREE;
+}
+
/* Handle a "register" attribute; arguments as in
struct attribute_spec.handler. */
*/
alias noSanitize = no_sanitize;
+/**
+ * Disables split-stack instrumentation for this function, overriding the
+ * `-fsplit-stack` commandline function.
+ *
+ * Examples:
+ * ---
+ * import gcc.attributes;
+ *
+ * @noSplitStack int user_function() { return 1; }
+ * ---
+ */
+enum noSplitStack = attribute("no_split_stack");
+
/**
* Sets the optimization strategy for a function.
* Valid strategies are "none", "optsize", "minsize". The strategies are