[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 10 Apr 2009 13:20:52 +0000 (15:20 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 10 Apr 2009 13:20:52 +0000 (15:20 +0200)
2009-04-10  Thomas Quinot  <quinot@adacore.com>

* xsnamest.adb: Use XUtil to have uniform line endings (UNIX style) in
generated files on all platforms.

2009-04-10  Robert Dewar  <dewar@adacore.com>

* sem_aux.adb: Minor reformatting

2009-04-10  Ed Schonberg  <schonberg@adacore.com>

* sem_ch3.adb (Access_Definition): Handle properly the case of a
protected function with formals that returns an anonymous access type.

2009-04-10  Thomas Quinot  <quinot@adacore.com>

* sem_disp.adb: Minor reformatting

2009-04-10  Vasiliy Fofanov  <fofanov@adacore.com>

* seh_init.c: Do not use the 32-bit specific implementation of
__gnat_install_SEH_handler on 64-bit Windows target (64-bit specific
version TBD).

2009-04-10  Jose Ruiz  <ruiz@adacore.com>

* mlib-tgt-specific-xi.adb (Get_Target_Prefix): Target_Name may contain
a '/' at the end so we better use the complete target name to determine
whether it is a PowerPC 55xx target.

From-SVN: r145898

gcc/ada/ChangeLog
gcc/ada/mlib-tgt-specific-xi.adb
gcc/ada/seh_init.c
gcc/ada/sem_aux.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_disp.adb
gcc/ada/xsnamest.adb

index 0e93d6d37302e3778f65a279458297fc5057cd95..0c842ddb7509a20b9eab4e16b73459a756e5463f 100644 (file)
@@ -1,3 +1,33 @@
+2009-04-10  Thomas Quinot  <quinot@adacore.com>
+
+       * xsnamest.adb: Use XUtil to have uniform line endings (UNIX style) in
+       generated files on all platforms.
+
+2009-04-10  Robert Dewar  <dewar@adacore.com>
+
+       * sem_aux.adb: Minor reformatting
+
+2009-04-10  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch3.adb (Access_Definition): Handle properly the case of a
+       protected function with formals that returns an anonymous access type.
+
+2009-04-10  Thomas Quinot  <quinot@adacore.com>
+
+       * sem_disp.adb: Minor reformatting
+
+2009-04-10  Vasiliy Fofanov  <fofanov@adacore.com>
+
+       * seh_init.c: Do not use the 32-bit specific implementation of
+       __gnat_install_SEH_handler on 64-bit Windows target (64-bit specific
+       version TBD).
+
+2009-04-10  Jose Ruiz  <ruiz@adacore.com>
+
+       * mlib-tgt-specific-xi.adb (Get_Target_Prefix): Target_Name may contain
+       a '/' at the end so we better use the complete target name to determine
+       whether it is a PowerPC 55xx target.
+
 2009-04-10  Thomas Quinot  <quinot@adacore.com>
 
        * sem_eval.adb: Minor reformatting
index 3a56d83712524899b36ed685be4dd230b42ddfe1..97e6e53be1f3c1ce3c7294ff227fed87db9db8e7 100644 (file)
@@ -155,8 +155,9 @@ package body MLib.Tgt.Specific is
       elsif Target_Name (Target_Name'First .. Index) = "leon" then
          return "leon-elf-";
       elsif Target_Name (Target_Name'First .. Index) = "powerpc" then
-         if Target_Name'Last - 6 >= Target_Name'First and then
-           Target_Name (Target_Name'Last - 6 .. Target_Name'Last) = "eabispe"
+         if Target_Name'Length >= 23 and then
+           Target_Name (Target_Name'First .. Target_Name'First + 22) =
+           "powerpc-unknown-eabispe"
          then
             return "powerpc-eabispe-";
          else
index def5af90a54cf490af3fac02d0e542e3a6dd71a7..2bc3d2315c91848659b3b56b40b507a3cdad6920 100644 (file)
@@ -59,7 +59,7 @@ extern struct Exception_Data _abort_signal;
 extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *);
 
 
-#ifdef _WIN32
+#if defined (_WIN32) && !defined (_WIN64)
 
 #include <windows.h>
 #include <excpt.h>
@@ -224,7 +224,7 @@ __gnat_install_SEH_handler (void *ER)
   asm ("mov %ecx,%fs:(0)");
 }
 
-#else /* _WIN32 */
+#else /* defined (_WIN32) && !defined (_WIN64) */
 /* For all non Windows targets we provide a dummy SEH install handler.  */
 void __gnat_install_SEH_handler (void *eh ATTRIBUTE_UNUSED)
 {
index 94db312c2e1e9f3d9707d79d42ed0fad4c88ec25..884c2bd4109c2924554d4514ad0ec89934b77066 100755 (executable)
@@ -107,9 +107,9 @@ package body Sem_Aux is
       Full_D : Node_Id;
 
    begin
-      --  If we have no declaration node, then return no constant value.
-      --  Not clear how this can happen, but it does sometimes and this is
-      --  the safest approach.
+      --  If we have no declaration node, then return no constant value. Not
+      --  clear how this can happen, but it does sometimes and this is the
+      --  safest approach.
 
       if No (D) then
          return Empty;
@@ -119,9 +119,9 @@ package body Sem_Aux is
       elsif Nkind (D) = N_Object_Renaming_Declaration then
          return Renamed_Object (Ent);
 
-      --  If this is a component declaration whose entity is constant, it
-      --  is a prival within a protected function. It does not have
-      --  a constant value.
+      --  If this is a component declaration whose entity is constant, it is
+      --  a prival within a protected function. It does not have a constant
+      --  value.
 
       elsif Nkind (D) = N_Component_Declaration then
          return Empty;
@@ -161,8 +161,8 @@ package body Sem_Aux is
       S : Entity_Id;
 
    begin
-      --  The following test is an error defense against some syntax
-      --  errors that can leave scopes very messed up.
+      --  The following test is an error defense against some syntax errors
+      --  that can leave scopes very messed up.
 
       if Ent = Standard_Standard then
          return Ent;
@@ -314,12 +314,12 @@ package body Sem_Aux is
 
    begin
       --  If the base type has no freeze node, it is a type in standard,
-      --  and always acts as its own first subtype unless it is one of
-      --  the predefined integer types. If the type is formal, it is also
-      --  a first subtype, and its base type has no freeze node. On the other
-      --  hand, a subtype of a generic formal is not its own first_subtype.
-      --  Its base type, if anonymous, is attached to the formal type decl.
-      --  from which the first subtype is obtained.
+      --  and always acts as its own first subtype unless it is one of the
+      --  predefined integer types. If the type is formal, it is also a first
+      --  subtype, and its base type has no freeze node. On the other hand, a
+      --  subtype of a generic formal is not its own first_subtype. Its base
+      --  type, if anonymous, is attached to the formal type decl. from which
+      --  the first subtype is obtained.
 
       if No (F) then
 
index 12abf172ef266e29ef414cb8751b6018e021f7fc..bc6635ffb8c7fbd09383f472ac4947c0004a6d14 100644 (file)
@@ -726,11 +726,12 @@ package body Sem_Ch3 is
      (Related_Nod : Node_Id;
       N           : Node_Id) return Entity_Id
    is
-      Loc        : constant Source_Ptr := Sloc (Related_Nod);
-      Anon_Type  : Entity_Id;
-      Anon_Scope : Entity_Id;
-      Desig_Type : Entity_Id;
-      Decl       : Entity_Id;
+      Loc                 : constant Source_Ptr := Sloc (Related_Nod);
+      Anon_Type           : Entity_Id;
+      Anon_Scope          : Entity_Id;
+      Desig_Type          : Entity_Id;
+      Decl                : Entity_Id;
+      Enclosing_Prot_Type : Entity_Id := Empty;
 
    begin
       if Is_Entry (Current_Scope)
@@ -767,9 +768,23 @@ package body Sem_Ch3 is
          --  is associated with one of the protected operations, and must
          --  be available in the scope that encloses the protected declaration.
          --  Otherwise the type is in the scope enclosing the subprogram.
+         --  If the function has formals, The return type of a subprogram
+         --  declaration is analyzed in the scope of the subprogram (see
+         --  Process_Formals) and thus the protected type, if present, is
+         --  the scope of the current function scope.
 
          if Ekind (Current_Scope) = E_Protected_Type then
-            Anon_Scope := Scope (Scope (Defining_Entity (Related_Nod)));
+            Enclosing_Prot_Type := Current_Scope;
+
+         elsif Ekind (Current_Scope) = E_Function
+           and then Ekind (Scope (Current_Scope)) = E_Protected_Type
+         then
+            Enclosing_Prot_Type := Scope (Current_Scope);
+         end if;
+
+         if Present (Enclosing_Prot_Type) then
+            Anon_Scope := Scope (Enclosing_Prot_Type);
+
          else
             Anon_Scope := Scope (Defining_Entity (Related_Nod));
          end if;
@@ -947,8 +962,8 @@ package body Sem_Ch3 is
       elsif Nkind (Related_Nod) = N_Function_Specification
         and then not From_With_Type (Anon_Type)
       then
-         if Ekind (Current_Scope) = E_Protected_Type then
-            Build_Itype_Reference (Anon_Type, Parent (Current_Scope));
+         if Present (Enclosing_Prot_Type) then
+            Build_Itype_Reference (Anon_Type, Parent (Enclosing_Prot_Type));
 
          elsif Is_List_Member (Parent (Related_Nod))
            and then Nkind (Parent (N)) /= N_Parameter_Specification
index e7419a813d7bb10e7ebb1750eec153cfa0181ed2..40778ddc9635bb1b547b53696acde812f329e3bd 100644 (file)
@@ -83,8 +83,8 @@ package body Sem_Disp is
       List : constant Elist_Id := Primitive_Operations (Tagged_Type);
 
    begin
-      --  The dispatching operation may already be on the list, if it the
-      --  wrapper for an inherited function of a null extension (see exp_ch3
+      --  The dispatching operation may already be on the list, if it is the
+      --  wrapper for an inherited function of a null extension (see Exp_Ch3
       --  for the construction of function wrappers). The list of primitive
       --  operations must not contain duplicates.
 
@@ -185,7 +185,7 @@ package body Sem_Disp is
                Set_Has_Controlling_Result (Subp);
 
                --  Check that result subtype statically matches first subtype
-               --  (Ada 2005) : Subp may have a controlling access result.
+               --  (Ada 2005): Subp may have a controlling access result.
 
                if Subtypes_Statically_Match (Typ, Etype (Subp))
                  or else (Ekind (Etype (Subp)) = E_Anonymous_Access_Type
@@ -236,8 +236,8 @@ package body Sem_Disp is
                Tagged_Type := Base_Type (Designated_Type (T));
             end if;
 
-         --  Ada 2005 : an incomplete type can be tagged. An operation with
-         --  an access parameter of the type is dispatching.
+         --  Ada 2005: an incomplete type can be tagged. An operation with an
+         --  access parameter of the type is dispatching.
 
          elsif Scope (Designated_Type (T)) = Current_Scope then
             Tagged_Type := Designated_Type (T);
@@ -256,14 +256,12 @@ package body Sem_Disp is
          end if;
       end if;
 
-      if No (Tagged_Type)
-        or else Is_Class_Wide_Type (Tagged_Type)
-      then
+      if No (Tagged_Type) or else Is_Class_Wide_Type (Tagged_Type) then
          return Empty;
 
-      --  The dispatching type and the primitive operation must be defined
-      --  in the same scope, except in the case of internal operations and
-      --  formal abstract subprograms.
+      --  The dispatching type and the primitive operation must be defined in
+      --  the same scope, except in the case of internal operations and formal
+      --  abstract subprograms.
 
       elsif ((Scope (Subp) = Scope (Tagged_Type) or else Is_Internal (Subp))
                and then (not Is_Generic_Type (Tagged_Type)
@@ -300,7 +298,7 @@ package body Sem_Disp is
 
       Static_Tag : Node_Id := Empty;
       --  If a controlling formal has a statically tagged actual, the tag of
-      --  this actual is to be used for any tag-indeterminate actual
+      --  this actual is to be used for any tag-indeterminate actual.
 
       procedure Check_Dispatching_Context;
       --  If the call is tag-indeterminate and the entity being called is
@@ -323,8 +321,8 @@ package body Sem_Disp is
               and then not Is_Abstract_Subprogram (Alias (Subp))
               and then No (DTC_Entity (Subp))
             then
-               --  Private overriding of inherited abstract operation,
-               --  call is legal.
+               --  Private overriding of inherited abstract operation, call is
+               --  legal.
 
                Set_Entity (Name (N), Alias (Subp));
                return;
@@ -399,7 +397,7 @@ package body Sem_Disp is
 
             --  If the formal is controlling but the actual is not, the type
             --  of the actual is statically known, and may be used as the
-            --  controlling tag for some other-indeterminate actual.
+            --  controlling tag for some other tag-indeterminate actual.
 
             elsif Is_Controlling_Formal (Formal)
               and then Is_Entity_Name (Actual)
@@ -412,18 +410,19 @@ package body Sem_Disp is
             Next_Formal (Formal);
          end loop;
 
-         --  If the call doesn't have a controlling actual but does have
-         --  an indeterminate actual that requires dispatching treatment,
-         --  then an object is needed that will serve as the controlling
-         --  argument for a dispatching call on the indeterminate actual.
-         --  This can only occur in the unusual situation of a default
-         --  actual given by a tag-indeterminate call and where the type
-         --  of the call is an ancestor of the type associated with a
-         --  containing call to an inherited operation (see AI-239).
-         --  Rather than create an object of the tagged type, which would
-         --  be problematic for various reasons (default initialization,
-         --  discriminants), the tag of the containing call's associated
-         --  tagged type is directly used to control the dispatching.
+         --  If the call doesn't have a controlling actual but does have an
+         --  indeterminate actual that requires dispatching treatment, then an
+         --  object is needed that will serve as the controlling argument for a
+         --  dispatching call on the indeterminate actual. This can only occur
+         --  in the unusual situation of a default actual given by a
+         --  tag-indeterminate call and where the type of the call is an
+         --  ancestor of the type associated with a containing call to an
+         --  inherited operation (see AI-239).
+
+         --  Rather than create an object of the tagged type, which would be
+         --  problematic for various reasons (default initialization,
+         --  discriminants), the tag of the containing call's associated tagged
+         --  type is directly used to control the dispatching.
 
          if No (Control)
            and then Indeterm_Ancestor_Call
@@ -460,11 +459,11 @@ package body Sem_Disp is
 
                   elsif Is_Tag_Indeterminate (Actual) then
 
-                     --  The tag is inherited from the enclosing call (the
-                     --  node we are currently analyzing). Explicitly expand
-                     --  the actual, since the previous call to Expand
-                     --  (from Resolve_Call) had no way of knowing about
-                     --  the required dispatching.
+                     --  The tag is inherited from the enclosing call (the node
+                     --  we are currently analyzing). Explicitly expand the
+                     --  actual, since the previous call to Expand (from
+                     --  Resolve_Call) had no way of knowing about the required
+                     --  dispatching.
 
                      Propagate_Tag (Control, Actual);
 
@@ -885,8 +884,8 @@ package body Sem_Disp is
 
       if Present (Old_Subp) then
 
-         --  If the type has interfaces we complete this check after we
-         --  set attribute Is_Dispatching_Operation
+         --  If the type has interfaces we complete this check after we set
+         --  attribute Is_Dispatching_Operation.
 
          Check_Subtype_Conformant (Subp, Old_Subp);
 
index 77cb96589fcdc111fd84eebe5ba6c291325ade82..2d6e8e97e080bc09070898908122a78dc547277d 100644 (file)
@@ -35,18 +35,24 @@ with Ada.Strings.Unbounded.Text_IO; use Ada.Strings.Unbounded.Text_IO;
 with Ada.Strings.Maps;              use Ada.Strings.Maps;
 with Ada.Strings.Maps.Constants;    use Ada.Strings.Maps.Constants;
 with Ada.Text_IO;                   use Ada.Text_IO;
+with Ada.Streams.Stream_IO;         use Ada.Streams.Stream_IO;
 
 with GNAT.Spitbol;                  use GNAT.Spitbol;
 with GNAT.Spitbol.Patterns;         use GNAT.Spitbol.Patterns;
 
+with XUtil;                         use XUtil;
+
 procedure XSnamesT is
 
-   InB  : File_Type;
-   InT  : File_Type;
-   OutS : File_Type;
-   OutB : File_Type;
-   InH  : File_Type;
-   OutH : File_Type;
+   subtype VString is GNAT.Spitbol.VString;
+
+   InS  : Ada.Text_IO.File_Type;
+   InB  : Ada.Text_IO.File_Type;
+   InH  : Ada.Text_IO.File_Type;
+
+   OutS : Ada.Streams.Stream_IO.File_Type;
+   OutB : Ada.Streams.Stream_IO.File_Type;
+   OutH : Ada.Streams.Stream_IO.File_Type;
 
    A, B  : VString := Nul;
    Line  : VString := Nul;
@@ -131,7 +137,7 @@ procedure XSnamesT is
 
       if Header_Current_Symbol /= S then
          declare
-            Name2 : Vstring;
+            Name2 : VString;
             Pat : constant Pattern := "#define  "
                                        & Header_Prefix (S).all
                                        & Break (' ') * Name2;
@@ -175,7 +181,7 @@ procedure XSnamesT is
 --  Start of processing for XSnames
 
 begin
-   Open (InT, In_File, "snames.ads-tmpl");
+   Open (InS, In_File, "snames.ads-tmpl");
    Open (InB, In_File, "snames.adb-tmpl");
    Open (InH, In_File, "snames.h-tmpl");
 
@@ -194,8 +200,8 @@ begin
 
    Put_Line (OutB, Line);
 
-   LoopN : while not End_Of_File (InT) loop
-      Line := Get_Line (InT);
+   LoopN : while not End_Of_File (InS) loop
+      Line := Get_Line (InS);
 
       if not Match (Line, Name_Ref) then
          Put_Line (OutS, Line);