diff options
author | obrien <obrien@FreeBSD.org> | 2002-05-09 20:02:13 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2002-05-09 20:02:13 +0000 |
commit | c8f5fc7032940ad6633f932ac40cade82ec4d0cc (patch) | |
tree | 29a0f0a6c79a69ecc64f612947a0fe5904311713 /contrib/gcc/attribs.c | |
parent | c9ab9ae440a8066b2c2b85b157b1fdadcf09916a (diff) | |
download | FreeBSD-src-c8f5fc7032940ad6633f932ac40cade82ec4d0cc.zip FreeBSD-src-c8f5fc7032940ad6633f932ac40cade82ec4d0cc.tar.gz |
Gcc 3.1.0 pre-release from the FSF anoncvs repo on 9-May-2002 15:57:15 EDT.
Diffstat (limited to 'contrib/gcc/attribs.c')
-rw-r--r-- | contrib/gcc/attribs.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/contrib/gcc/attribs.c b/contrib/gcc/attribs.c index 7cb1172..b915c88 100644 --- a/contrib/gcc/attribs.c +++ b/contrib/gcc/attribs.c @@ -51,6 +51,8 @@ static tree handle_noreturn_attribute PARAMS ((tree *, tree, tree, int, bool *)); static tree handle_noinline_attribute PARAMS ((tree *, tree, tree, int, bool *)); +static tree handle_always_inline_attribute PARAMS ((tree *, tree, tree, int, + bool *)); static tree handle_used_attribute PARAMS ((tree *, tree, tree, int, bool *)); static tree handle_unused_attribute PARAMS ((tree *, tree, tree, int, @@ -109,6 +111,8 @@ static const struct attribute_spec c_common_attribute_table[] = handle_noreturn_attribute }, { "noinline", 0, 0, true, false, false, handle_noinline_attribute }, + { "always_inline", 0, 0, true, false, false, + handle_always_inline_attribute }, { "used", 0, 0, true, false, false, handle_used_attribute }, { "unused", 0, 0, false, false, false, @@ -382,7 +386,9 @@ decl_attributes (node, attributes, flags) /* Layout the decl in case anything changed. */ if (spec->type_required && DECL_P (*node) - && TREE_CODE (*node) == VAR_DECL) + && (TREE_CODE (*node) == VAR_DECL + || TREE_CODE (*node) == PARM_DECL + || TREE_CODE (*node) == RESULT_DECL)) { /* Force a recalculation of mode and size. */ DECL_MODE (*node) = VOIDmode; @@ -563,6 +569,31 @@ handle_noinline_attribute (node, name, args, flags, no_add_attrs) return NULL_TREE; } +/* Handle a "always_inline" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_always_inline_attribute (node, name, args, flags, no_add_attrs) + tree *node; + tree name; + tree args ATTRIBUTE_UNUSED; + int flags ATTRIBUTE_UNUSED; + bool *no_add_attrs; +{ + if (TREE_CODE (*node) == FUNCTION_DECL) + { + /* Do nothing else, just set the attribute. We'll get at + it later with lookup_attribute. */ + } + else + { + warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + + return NULL_TREE; +} + /* Handle a "used" attribute; arguments as in struct attribute_spec.handler. */ @@ -1431,3 +1462,4 @@ strip_attrs (specs_attrs) return specs; } + |