]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 18 Jul 2014 11:04:34 +0000 (13:04 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 18 Jul 2014 11:04:34 +0000 (13:04 +0200)
2014-07-18  Robert Dewar  <dewar@adacore.com>

* exp_ch7.adb: Minor reformatting.

2014-07-18  Claire Dross  <dross@adacore.com>

* sem_aux.ads (Get_Binary_Nkind): New function that returns
the Node_Kind value of an entity defining a binary operator.
(Get_Unary_Nkind): New function that returns the Node_Kind value
of an entity defining a unary operator.

2014-07-18  Pascal Obry  <obry@adacore.com>

* sysdep.c: comment update.
* adaint.c (__gnat_fputwc): Use wchar_t on a limited set of
platforms where it is known to be supported.

2014-07-18  Thomas Quinot  <quinot@adacore.com>

* sem_dist.adb (Process_Remote_AST_Declaration): Need
to set Fat_Type's Ekind in order to be able to use its
Corresponding_Remote_Type attribute.

From-SVN: r212815

gcc/ada/ChangeLog
gcc/ada/adaint.c
gcc/ada/exp_ch7.adb
gcc/ada/sem_aux.adb
gcc/ada/sem_aux.ads
gcc/ada/sem_dist.adb
gcc/ada/sysdep.c

index ac04798710c2f585cadee5b2dab3ccf9eddc8b1a..722aa7eeb71886e92becd663dd84d1b9df950b41 100644 (file)
@@ -1,3 +1,26 @@
+2014-07-18  Robert Dewar  <dewar@adacore.com>
+
+       * exp_ch7.adb: Minor reformatting.
+
+2014-07-18  Claire Dross  <dross@adacore.com>
+
+       * sem_aux.ads (Get_Binary_Nkind): New function that returns
+       the Node_Kind value of an entity defining a binary operator.
+       (Get_Unary_Nkind): New function that returns the Node_Kind value
+       of an entity defining a unary operator.
+
+2014-07-18  Pascal Obry  <obry@adacore.com>
+
+       * sysdep.c: comment update.
+       * adaint.c (__gnat_fputwc): Use wchar_t on a limited set of
+       platforms where it is known to be supported.
+
+2014-07-18  Thomas Quinot  <quinot@adacore.com>
+
+       * sem_dist.adb (Process_Remote_AST_Declaration): Need
+       to set Fat_Type's Ekind in order to be able to use its
+       Corresponding_Remote_Type attribute.
+
 2014-07-18  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * einfo.adb Last_Aggregate_Assignment is now Node 30.
index 84c67f58feae70a28be30d26bf1efd596c02cd27..81b2d147521c3d30e34e2a9c3c6c13f5a9ae7290 100644 (file)
@@ -229,9 +229,6 @@ extern unsigned int LIB$CALLG_64 (unsigned long long argument_list [],
 
 #else
 #include <utime.h>
-#if ! defined (__vxworks)
-#include <wchar.h>
-#endif
 #endif
 
 #if defined (_WIN32)
@@ -854,10 +851,19 @@ __gnat_rmdir (char *path)
 #endif
 }
 
+#if defined (_WIN32) || defined (linux) || defined (sun) \
+  || defined (__FreeBSD__)
+#define HAS_TARGET_WCHAR_T
+#endif
+
+#ifdef HAS_TARGET_WCHAR_T
+#include <wchar.h>
+#endif
+
 int
 __gnat_fputwc(int c, FILE *stream)
 {
-#if ! defined (__vxworks)
+#ifdef HAS_TARGET_WCHAR_T
   return fputwc ((wchar_t)c, stream);
 #else
   return fputc (c, stream);
index c6bec4b1fa8f34795efcb833e89ba4af6a8887ce..748279b60b67b346861be24fdf4577619c7ba8e3 100644 (file)
@@ -2610,7 +2610,7 @@ package body Exp_Ch7 is
              Label_Construct     => Label));
 
          --  Create the associated jump with this object, generate:
-         --
+
          --    when <counter> =>
          --       goto L<counter>;
 
@@ -2623,7 +2623,7 @@ package body Exp_Ch7 is
                  Name => New_Occurrence_Of (Entity (Label_Id), Loc)))));
 
          --  Insert the jump destination, generate:
-         --
+
          --     <<L<counter>>>
 
          Append_To (Finalizer_Stmts, Label);
@@ -2742,7 +2742,7 @@ package body Exp_Ch7 is
             --          Free (Ptr_Typ (Temp));
             --       end;
             --    end if;
-            --
+
             --  The generated code effectively detaches the temporary from the
             --  caller finalization master and deallocates the object. This is
             --  disabled on .NET/JVM because pools are not supported.
index 3f9522152b65acd0c4668fb8851340d2342d8455..0344637dccc672078eaf55a596e476399d0249cb 100644 (file)
@@ -32,7 +32,6 @@
 
 with Atree;  use Atree;
 with Einfo;  use Einfo;
-with Sinfo;  use Sinfo;
 with Snames; use Snames;
 with Stand;  use Stand;
 with Uintp;  use Uintp;
@@ -435,6 +434,52 @@ package body Sem_Aux is
       return Empty;
    end First_Tag_Component;
 
+   ---------------------
+   -- Get_Binary_Nkind --
+   ---------------------
+
+   function Get_Binary_Nkind (Op : Entity_Id) return Node_Kind is
+      Name : constant String := Get_Name_String (Chars (Op));
+   begin
+      if Name = "Oadd" then
+         return N_Op_Add;
+      elsif Name = "Oconcat" then
+         return N_Op_Concat;
+      elsif Name = "Oexpon" then
+         return N_Op_Expon;
+      elsif Name = "Osubtract" then
+         return N_Op_Subtract;
+      elsif Name = "Omod" then
+         return N_Op_Mod;
+      elsif Name = "Omultiply" then
+         return N_Op_Multiply;
+      elsif Name = "Odivide" then
+         return N_Op_Divide;
+      elsif Name = "Orem" then
+         return N_Op_Rem;
+      elsif Name = "Oand" then
+         return N_Op_And;
+      elsif Name = "Oeq" then
+         return N_Op_Eq;
+      elsif Name = "Oge" then
+         return N_Op_Ge;
+      elsif Name = "Ogt" then
+         return N_Op_Gt;
+      elsif Name = "Ole" then
+         return N_Op_Le;
+      elsif Name = "Olt" then
+         return N_Op_Lt;
+      elsif Name = "One" then
+         return N_Op_Ne;
+      elsif Name = "Oxor" then
+         return N_Op_Or;
+      elsif Name = "Oor" then
+         return N_Op_Xor;
+      else
+         raise Program_Error;
+      end if;
+   end Get_Binary_Nkind;
+
    ------------------
    -- Get_Rep_Item --
    ------------------
@@ -602,6 +647,26 @@ package body Sem_Aux is
       return Empty;
    end Get_Rep_Pragma;
 
+   ---------------------
+   -- Get_Unary_Nkind --
+   ---------------------
+
+   function Get_Unary_Nkind (Op : Entity_Id) return Node_Kind is
+      Name : constant String := Get_Name_String (Chars (Op));
+   begin
+      if Name = "Oabs" then
+         return N_Op_Abs;
+      elsif Name = "Osubtract" then
+         return N_Op_Minus;
+      elsif Name = "Onot" then
+         return N_Op_Not;
+      elsif Name = "Oadd" then
+         return N_Op_Plus;
+      else
+         raise Program_Error;
+      end if;
+   end Get_Unary_Nkind;
+
    ---------------------------------
    -- Has_External_Tag_Rep_Clause --
    ---------------------------------
index 1fb9068213d8c75cc82917b158975c621228f0aa..4eaf1bfb3ce28eaacd90615e50b0a174f60b6027 100644 (file)
@@ -42,6 +42,7 @@ with Alloc; use Alloc;
 with Namet; use Namet;
 with Table;
 with Types; use Types;
+with Sinfo; use Sinfo;
 
 package Sem_Aux is
 
@@ -384,4 +385,18 @@ package Sem_Aux is
    --  Given an entity for a package or generic package, return corresponding
    --  package specification. Simplifies handling of child units, and better
    --  than the old idiom: Specification (Unit_Declaration_Node (Pack_Id)).
+
+   function Get_Binary_Nkind (Op : Entity_Id) return Node_Kind;
+   --  Op must be an entity with an Ekind of E_Operator.
+   --  This function returns the Nkind value that would
+   --  be used to construct a binary operator node referencing
+   --  this entity. It is an error to call this function
+   --  if Ekind (Op) /= E_Operator.
+
+   function Get_Unary_Nkind (Op : Entity_Id) return Node_Kind;
+   --  Op must be an entity with an Ekind of E_Operator.
+   --  This function returns the Nkind value that would
+   --  be used to construct a unary operator node referencing
+   --  this entity. It is an error to call this function
+   --  if Ekind (Op) /= E_Operator.
 end Sem_Aux;
index f3d3e33ff770d7c232aaa1da2e351d6ce76b3c31..5bb273bab2a8e661712f8bec74db6d181dc1f7e4 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2012, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2014, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -647,7 +647,14 @@ package body Sem_Dist is
                           New_Occurrence_Of (RACW_Type, Loc)))))));
 
       Set_Equivalent_Type (User_Type, Fat_Type);
+
+      --  Set Fat_Type's Etype early so that we can use its
+      --  Corresponding_Remote_Type attribute, whose presence indicates that
+      --  this is the record type used to implement a RAS.
+
+      Set_Ekind (Fat_Type, E_Record_Type);
       Set_Corresponding_Remote_Type (Fat_Type, User_Type);
+
       Insert_After_And_Analyze (Subpkg_Body, Fat_Type_Decl);
 
       --  The reason we suppress the initialization procedure is that we know
index e2187e7472027bc792b0b1898e6918ca66b7372d..207ef60919ecdf467deff4bf40f7af91260af34c 100644 (file)
@@ -105,11 +105,11 @@ extern struct tm *localtime_r(const time_t *, struct tm *);
    end-of-file.
 
    The other target dependent declarations here are for the three functions
-   __gnat_set_binary_mode, __gnat_set_text_mode and __gnat_set_wide_text_mode:
+   __gnat_set_binary_mode, __gnat_set_text_mode and __gnat_set_mode:
 
       void __gnat_set_binary_mode (int handle);
       void __gnat_set_text_mode   (int handle);
-      void __gnat_set_wide_text_mode   (int handle);
+      void __gnat_set_mode        (int handle, int mode);
 
    These functions have no effect in Unix (or similar systems where there is
    no distinction between binary and text files), but in DOS (and similar