aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-11-08 00:01:23 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2006-11-08 00:01:23 +0100
commit4eb7fd8398359a44e2483b61c539508497fe9fcd (patch)
treeef34d7e6f5808177003e88ab3eb698579a33ddb9 /gcc/c-common.c
parenta7f02c2d27203d8e3581bfdc19f86f863ebf0d80 (diff)
downloadgcc-4eb7fd8398359a44e2483b61c539508497fe9fcd.zip
gcc-4eb7fd8398359a44e2483b61c539508497fe9fcd.tar.gz
gcc-4eb7fd8398359a44e2483b61c539508497fe9fcd.tar.bz2
c-common.c (c_common_attributes): Add gnu_inline attribyte.
* c-common.c (c_common_attributes): Add gnu_inline attribyte. (handle_gnu_inline_attribute): New function. * c-decl.c (diagnose_mismatched_decls): Handle gnu_inline attribute. (merge_decls, start_decl, start_function): Likewise. * doc/extend.texi: Document gnu_inline attribute. * gcc.dg/inline-17.c: New test. From-SVN: r118567
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 47cda1b..0603da6 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -510,6 +510,8 @@ static tree handle_noreturn_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_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 *);
@@ -578,6 +580,8 @@ const struct attribute_spec c_common_attribute_table[] =
handle_noinline_attribute },
{ "always_inline", 0, 0, true, false, false,
handle_always_inline_attribute },
+ { "gnu_inline", 0, 0, true, false, false,
+ handle_gnu_inline_attribute },
{ "flatten", 0, 0, true, false, false,
handle_flatten_attribute },
{ "used", 0, 0, true, false, false,
@@ -4268,6 +4272,29 @@ handle_always_inline_attribute (tree *node, tree name,
return NULL_TREE;
}
+/* Handle a "gnu_inline" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_gnu_inline_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. */