Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions gcc/jit/dummy-frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ static tree handle_alias_attribute (tree *, tree, tree, int, bool *);
static tree handle_always_inline_attribute (tree *, tree, tree, int,
bool *);
static tree handle_cold_attribute (tree *, tree, tree, int, bool *);
static tree handle_common_attribute (tree *, tree, tree, int, bool *);
static tree handle_const_attribute (tree *, tree, tree, int, bool *);
static tree handle_fnspec_attribute (tree *, tree, tree, int, bool *);
static tree handle_format_arg_attribute (tree *, tree, tree, int, bool *);
Expand Down Expand Up @@ -153,6 +154,13 @@ extern const struct attribute_spec::exclusions attr_cold_hot_exclusions[] =
ATTR_EXCL (NULL, false, false, false)
};

static const struct attribute_spec::exclusions attr_common_exclusions[] =
{
ATTR_EXCL ("common", true, true, true),
ATTR_EXCL ("nocommon", true, true, true),
ATTR_EXCL (NULL, false, false, false),
};

static const struct attribute_spec::exclusions attr_noinline_exclusions[] =
{
ATTR_EXCL ("always_inline", true, true, true),
Expand Down Expand Up @@ -201,6 +209,9 @@ static const attribute_spec jit_gnu_attributes[] =
{ "cold", 0, 0, true, false, false, false,
handle_cold_attribute,
attr_cold_hot_exclusions },
{ "common", 0, 0, true, false, false, false,
handle_common_attribute,
attr_common_exclusions },
/* The same comments as for noreturn attributes apply to const ones. */
{ "const", 0, 0, true, false, false, false,
handle_const_attribute,
Expand Down Expand Up @@ -783,6 +794,24 @@ handle_cold_attribute (tree *node, tree name, tree ARG_UNUSED (args),
return NULL_TREE;
}

/* Handle a "common" attribute; arguments as in
struct attribute_spec.handler. */

static tree
handle_common_attribute (tree *node, tree name, tree ARG_UNUSED (args),
int ARG_UNUSED (flags), bool *no_add_attrs)
{
if (VAR_P (*node))
DECL_COMMON (*node) = 1;
else
{
warning (OPT_Wattributes, "%qE attribute ignored", name);
*no_add_attrs = true;
}

return NULL_TREE;
}

/* Handle a "noinline" attribute; arguments as in
struct attribute_spec.handler. */

Expand Down
Loading