[Ada] Remove handling of 'Pos and 'Val attributes from gigi
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 10 Apr 2020 09:19:22 +0000 (09:19 +0000)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 19 Jun 2020 08:17:31 +0000 (04:17 -0400)
2020-06-19  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* gcc-interface/trans.c (lvalue_required_for_attribute_p): Do not deal
with 'Pos or 'Val.
(Attribute_to_gnu): Likewise.
* gcc-interface/utils.c (create_field_decl): Small formatting fix.

gcc/ada/gcc-interface/trans.c
gcc/ada/gcc-interface/utils.c

index 3a6aa75..313a2fb 100644 (file)
@@ -773,8 +773,6 @@ lvalue_required_for_attribute_p (Node_Id gnat_node)
 {
   switch (Get_Attribute_Id (Attribute_Name (gnat_node)))
     {
-    case Attr_Pos:
-    case Attr_Val:
     case Attr_Pred:
     case Attr_Succ:
     case Attr_First:
@@ -1701,17 +1699,6 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
 
   switch (attribute)
     {
-    case Attr_Pos:
-    case Attr_Val:
-      /* These are just conversions since representation clauses for
-        enumeration types are handled in the front-end.  */
-      gnu_expr = gnat_to_gnu (First (Expressions (gnat_node)));
-      if (attribute == Attr_Pos)
-       gnu_expr = maybe_character_value (gnu_expr);
-      gnu_result_type = get_unpadded_type (Etype (gnat_node));
-      gnu_result = convert (gnu_result_type, gnu_expr);
-      break;
-
     case Attr_Pred:
     case Attr_Succ:
       /* These just add or subtract the constant 1 since representation
index 2a6ed04..7adc313 100644 (file)
@@ -3017,7 +3017,7 @@ create_field_decl (tree name, tree type, tree record_type, tree size, tree pos,
       unsigned int known_align;
 
       if (tree_fits_uhwi_p (pos))
-       known_align = tree_to_uhwi (pos) & - tree_to_uhwi (pos);
+       known_align = tree_to_uhwi (pos) & -tree_to_uhwi (pos);
       else
        known_align = BITS_PER_UNIT;