!= lookup_attribute ("progmem", attributes))
return -1;
- tree a = decl;
-
- do
- a = TREE_TYPE (a);
- while (TREE_CODE (a) == ARRAY_TYPE);
+ tree a = strip_array_types (TREE_TYPE (decl));
if (a == error_mark_node)
return 0;
static addr_space_t
avr_nonconst_pointer_addrspace (tree typ)
{
- while (ARRAY_TYPE == TREE_CODE (typ))
- typ = TREE_TYPE (typ);
+ typ = strip_array_types (typ);
if (POINTER_TYPE_P (typ))
{
/* "Ordinary" pointers... */
- while (TREE_CODE (target) == ARRAY_TYPE)
- target = TREE_TYPE (target);
+ target = strip_array_types (target);
/* Pointers to non-generic address space must be const. */
&& (TREE_STATIC (node) || DECL_EXTERNAL (node))
&& avr_progmem_p (node, *attributes))
{
- tree node0 = node;
-
/* For C++, we have to peel arrays in order to get correct
determination of readonlyness. */
- do
- node0 = TREE_TYPE (node0);
- while (TREE_CODE (node0) == ARRAY_TYPE);
+ tree node0 = strip_array_types (TREE_TYPE (node));
if (error_mark_node == node0)
return;
// C++ requires peeling arrays.
- do
- node = TREE_TYPE (node);
- while (ARRAY_TYPE == TREE_CODE (node));
+ node = strip_array_types (TREE_TYPE (node));
return (node != error_mark_node
&& !TYPE_READONLY (node));