summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-08 17:05:23 +0000
committerfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-08 17:05:23 +0000
commitc33080b9c4e62eee8e2459d79b45489200f8fc55 (patch)
treee61a834b9d87f991a0510f3ef3272372cd473ce0 /gcc/ada
parentf2606961d203fb75a39acd9714a9fbc62765c8ae (diff)
downloadgcc-c33080b9c4e62eee8e2459d79b45489200f8fc55.tar.gz
gcc/ada/
* gcc-interface/utils.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES (handle_type_generic_attribute): Likewise. gcc/c-family/ * c-common.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES. (handle_type_generic_attribute): Likewise. gcc/lto/ * lto-lang.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES. (handle_type_generic_attribute): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172200 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/gcc-interface/utils.c15
2 files changed, 8 insertions, 13 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 033c211fde2..155256e068c 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-08 Nathan Froyd <froydnj@codesourcery.com>
+
+ * gcc-interface/utils.c (handle_sentinel_attribute): Don't use
+ TYPE_ARG_TYPES
+ (handle_type_generic_attribute): Likewise.
+
2011-04-04 Eric Botcazou <ebotcazou@adacore.com>
PR ada/47163
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index dc743740cfe..8a787893074 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -5266,8 +5266,6 @@ static tree
handle_sentinel_attribute (tree *node, tree name, tree args,
int ARG_UNUSED (flags), bool *no_add_attrs)
{
- tree params = TYPE_ARG_TYPES (*node);
-
if (!prototype_p (*node))
{
warning (OPT_Wattributes,
@@ -5277,10 +5275,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
}
else
{
- while (TREE_CHAIN (params))
- params = TREE_CHAIN (params);
-
- if (VOID_TYPE_P (TREE_VALUE (params)))
+ if (!stdarg_p (*node))
{
warning (OPT_Wattributes,
"%qs attribute only applies to variadic functions",
@@ -5400,17 +5395,11 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name),
tree ARG_UNUSED (args), int ARG_UNUSED (flags),
bool * ARG_UNUSED (no_add_attrs))
{
- tree params;
-
/* Ensure we have a function type. */
gcc_assert (TREE_CODE (*node) == FUNCTION_TYPE);
- params = TYPE_ARG_TYPES (*node);
- while (params && ! VOID_TYPE_P (TREE_VALUE (params)))
- params = TREE_CHAIN (params);
-
/* Ensure we have a variadic function. */
- gcc_assert (!params);
+ gcc_assert (!prototype_p (*node) || stdarg_p (*node));
return NULL_TREE;
}