diff options
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 0f4d695..3b5f477 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -515,8 +515,8 @@ static tree handle_cold_attribute (tree *, tree, tree, int, bool *); static tree handle_noinline_attribute (tree *, tree, tree, int, bool *); static tree handle_always_inline_attribute (tree *, tree, tree, int, bool *); -static tree handle_gnu_inline_attribute (tree *, tree, tree, int, - bool *); +static tree handle_gnu_inline_attribute (tree *, tree, tree, int, bool *); +static tree handle_artificial_attribute (tree *, tree, tree, int, bool *); static tree handle_flatten_attribute (tree *, tree, tree, int, bool *); static tree handle_used_attribute (tree *, tree, tree, int, bool *); static tree handle_unused_attribute (tree *, tree, tree, int, bool *); @@ -589,6 +589,8 @@ const struct attribute_spec c_common_attribute_table[] = handle_always_inline_attribute }, { "gnu_inline", 0, 0, true, false, false, handle_gnu_inline_attribute }, + { "artificial", 0, 0, true, false, false, + handle_artificial_attribute }, { "flatten", 0, 0, true, false, false, handle_flatten_attribute }, { "used", 0, 0, true, false, false, @@ -4877,6 +4879,29 @@ handle_gnu_inline_attribute (tree *node, tree name, return NULL_TREE; } +/* Handle an "artificial" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_artificial_attribute (tree *node, tree name, + tree ARG_UNUSED (args), + int ARG_UNUSED (flags), + bool *no_add_attrs) +{ + if (TREE_CODE (*node) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (*node)) + { + /* Do nothing else, just set the attribute. We'll get at + it later with lookup_attribute. */ + } + else + { + warning (OPT_Wattributes, "%qE attribute ignored", name); + *no_add_attrs = true; + } + + return NULL_TREE; +} + /* Handle a "flatten" attribute; arguments as in struct attribute_spec.handler. */ |