OSDN Git Service

* back-end.adb (Call_Back_End): Pass Standard_Character to gigi.
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 17 Apr 2010 08:24:16 +0000 (08:24 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:33:34 +0000 (14:33 +0900)
* gcc-interface/gigi.h (gigi): Add standard_character parameter.
(CHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE,
LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE,
LONG_DOUBLE_TYPE_SIZE, SIZE_TYPE): Delete.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Subtype>: Call
rm_size.
* gcc-interface/misc.c (gnat_init): Set signedness of char as per
flag_signed_char.  Tag sizetype with "size_type" moniker.
* gcc-interface/trans.c (gigi): Add standard_character parameter.
Remove useless built-in types.  Equate unsigned_char_type_node to
Standard.Character.  Use it instead of char_type_node throughout.
(Attribute_to_gnu): Likewise.
(gnat_to_gnu): Likewise.
* gcc-interface/utils2.c (build_call_raise): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158462 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/misc.c
gcc/ada/gcc-interface/utils2.c

index 21800d8..2a0af0b 100644 (file)
@@ -1,5 +1,23 @@
 2010-04-17  Eric Botcazou  <ebotcazou@adacore.com>
 
+       * back-end.adb (Call_Back_End): Pass Standard_Character to gigi.
+       * gcc-interface/gigi.h (gigi): Add standard_character parameter.
+       (CHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, 
+       LONG_LONG_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE,
+       LONG_DOUBLE_TYPE_SIZE, SIZE_TYPE): Delete.
+       * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Subtype>: Call
+       rm_size.
+       * gcc-interface/misc.c (gnat_init): Set signedness of char as per
+       flag_signed_char.  Tag sizetype with "size_type" moniker.
+       * gcc-interface/trans.c (gigi): Add standard_character parameter.
+       Remove useless built-in types.  Equate unsigned_char_type_node to
+       Standard.Character.  Use it instead of char_type_node throughout.
+       (Attribute_to_gnu): Likewise.
+       (gnat_to_gnu): Likewise.
+       * gcc-interface/utils2.c (build_call_raise): Likewise.
+
+2010-04-17  Eric Botcazou  <ebotcazou@adacore.com>
+
        * gcc-interface/gigi.h (enum standard_datatypes): Add new values
        ADT_sbitsize_one_node and ADT_sbitsize_unit_node.
        (sbitsize_one_node): New macro.
index b7fd331..5d6bc79 100644 (file)
@@ -2113,7 +2113,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
            {
              tree gnu_index_type = get_unpadded_type (Etype (gnat_index));
              const int prec_comp
-               = compare_tree_int (TYPE_RM_SIZE (gnu_index_type),
+               = compare_tree_int (rm_size (gnu_index_type),
                                    TYPE_PRECISION (sizetype));
              const bool subrange_p = (prec_comp < 0
                                       && (TYPE_UNSIGNED (gnu_index_type)
index 2806db8..481c85a 100644 (file)
@@ -385,8 +385,9 @@ static bool
 gnat_init (void)
 {
   /* Do little here, most of the standard declarations are set up after the
-     front-end has been run.  */
-  build_common_tree_nodes (true, true);
+     front-end has been run.  Use the same `char' as C, this doesn't really
+     matter since we'll use the explicit `unsigned char' for Character.  */
+  build_common_tree_nodes (flag_signed_char, true);
 
   /* In Ada, we use a signed type for SIZETYPE.  Use the signed type
      corresponding to the width of Pmode.  In most cases when ptr_mode
@@ -394,6 +395,7 @@ gnat_init (void)
      But we get far better code using the width of Pmode.  */
   size_type_node = gnat_type_for_mode (Pmode, 0);
   set_sizetype (size_type_node);
+  TYPE_NAME (sizetype) = get_identifier ("size_type");
 
   /* In Ada, we use an unsigned 8-bit type for the default boolean type.  */
   boolean_type_node = make_unsigned_type (8);
index ca35cc7..be7044b 100644 (file)
@@ -1499,12 +1499,13 @@ build_call_raise (int msg, Node_Id gnat_node, char kind)
     = (gnat_node != Empty && Sloc (gnat_node) != No_Location)
       ? Get_Logical_Line_Number (Sloc(gnat_node)) : input_line;
 
-  TREE_TYPE (filename)
-    = build_array_type (char_type_node, build_index_type (size_int (len)));
+  TREE_TYPE (filename) = build_array_type (unsigned_char_type_node,
+                                          build_index_type (size_int (len)));
 
   return
     build_call_2_expr (fndecl,
-                      build1 (ADDR_EXPR, build_pointer_type (char_type_node),
+                      build1 (ADDR_EXPR,
+                              build_pointer_type (unsigned_char_type_node),
                               filename),
                       build_int_cst (NULL_TREE, line_number));
 }