diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2019-05-28 07:23:54 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2019-05-28 07:23:54 +0000 |
commit | e6ca6782acfa8b126c6abb6bcd9026572217525d (patch) | |
tree | 39350ea31fe3ddef3e71cd7cadf53f99b4f0a2b7 /gcc | |
parent | eabf2b44483427d54be93ae7628065aa08c4a1e6 (diff) | |
download | gcc-e6ca6782acfa8b126c6abb6bcd9026572217525d.zip gcc-e6ca6782acfa8b126c6abb6bcd9026572217525d.tar.gz gcc-e6ca6782acfa8b126c6abb6bcd9026572217525d.tar.bz2 |
utils.c (gnat_internal_attribute_table): Add support for stack_protect attribute.
* gcc-interface/utils.c (gnat_internal_attribute_table): Add support
for stack_protect attribute.
(handle_stack_protect_attribute): New static function.
From-SVN: r271680
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 19 |
2 files changed, 25 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 377b13e..6acef36 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,11 @@ 2019-05-28 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/utils.c (gnat_internal_attribute_table): Add support + for stack_protect attribute. + (handle_stack_protect_attribute): New static function. + +2019-05-28 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/decl.c (intrin_arglists_compatible_p): Do not return false if the internal builtin uses a variable list. diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 4d3facc..d090d09 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -90,6 +90,7 @@ static tree handle_novops_attribute (tree *, tree, tree, int, bool *); static tree handle_nonnull_attribute (tree *, tree, tree, int, bool *); static tree handle_sentinel_attribute (tree *, tree, tree, int, bool *); static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *); +static tree handle_stack_protect_attribute (tree *, tree, tree, int, bool *); static tree handle_noinline_attribute (tree *, tree, tree, int, bool *); static tree handle_noclone_attribute (tree *, tree, tree, int, bool *); static tree handle_leaf_attribute (tree *, tree, tree, int, bool *); @@ -123,6 +124,8 @@ const struct attribute_spec gnat_internal_attribute_table[] = handle_sentinel_attribute, NULL }, { "noreturn", 0, 0, true, false, false, false, handle_noreturn_attribute, NULL }, + { "stack_protect",0, 0, true, false, false, false, + handle_stack_protect_attribute, NULL }, { "noinline", 0, 0, true, false, false, false, handle_noinline_attribute, NULL }, { "noclone", 0, 0, true, false, false, false, @@ -6357,6 +6360,22 @@ handle_noinline_attribute (tree *node, tree name, return NULL_TREE; } +/* Handle a "stack_protect" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_stack_protect_attribute (tree *node, tree name, tree, int, + bool *no_add_attrs) +{ + if (TREE_CODE (*node) != FUNCTION_DECL) + { + warning (OPT_Wattributes, "%qE attribute ignored", name); + *no_add_attrs = true; + } + + return NULL_TREE; +} + /* Handle a "noclone" attribute; arguments as in struct attribute_spec.handler. */ |