[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 28 Oct 2009 13:50:10 +0000 (14:50 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 28 Oct 2009 13:50:10 +0000 (14:50 +0100)
2009-10-28  Robert Dewar  <dewar@adacore.com>

* exp_attr.adb, exp_ch9.adb, prj-nmsc.adb, tbuild.adb, ali.adb,
types.ads: Minor reformatting

2009-10-28  Tristan Gingold  <gingold@adacore.com>

* init.c: Fix __gnat_error_handler for Darwin10 (Snow Leopard)

From-SVN: r153658

gcc/ada/ChangeLog
gcc/ada/ali.adb
gcc/ada/exp_attr.adb
gcc/ada/exp_ch9.adb
gcc/ada/init.c
gcc/ada/prj-nmsc.adb
gcc/ada/tbuild.adb
gcc/ada/types.ads

index 7cc30bb7d4a4e60b7b36f82f8c7c7a1aaf9b1855..226fb9526df2f24b50ab9796238472e4409cd1b3 100644 (file)
@@ -1,3 +1,12 @@
+2009-10-28  Robert Dewar  <dewar@adacore.com>
+
+       * exp_attr.adb, exp_ch9.adb, prj-nmsc.adb, tbuild.adb, ali.adb,
+       types.ads: Minor reformatting
+
+2009-10-28  Tristan Gingold  <gingold@adacore.com>
+
+       * init.c: Fix __gnat_error_handler for Darwin10 (Snow Leopard)
+
 2009-10-28  Thomas Quinot  <quinot@adacore.com>
 
        * exp_ch4.adb (Expand_N_Type_Conversion): Perform Integer promotion for
index b2357eae970716fc2145507f2c5daf3df647cc67..20438cf66e63386aa684e71792b8ad56c4e60010 100644 (file)
@@ -190,7 +190,7 @@ package body ALI is
 
       function Get_Name
         (Ignore_Spaces  : Boolean := False;
-         Ignore_Special : Boolean := False)return Name_Id;
+         Ignore_Special : Boolean := False) return Name_Id;
       --  Skip blanks, then scan out a name (name is left in Name_Buffer with
       --  length in Name_Len, as well as being returned in Name_Id form).
       --  If Lower is set to True then the Name_Buffer will be converted to
index 67babece63d3b204fa878f72ffd5e9ccbece2d1a..48bd566b38babfebd1c4811058ce32d11e7732b3 100644 (file)
@@ -661,12 +661,10 @@ package body Exp_Attr is
 
       if Is_Protected_Self_Reference (Pref)
            and then not
-             (Nkind_In (Parent (N),
-                N_Index_Or_Discriminant_Constraint,
-                N_Discriminant_Association)
-                and then
-              Nkind (Parent (Parent (Parent (Parent (N)))))
-                = N_Component_Definition)
+             (Nkind_In (Parent (N), N_Index_Or_Discriminant_Constraint,
+                                    N_Discriminant_Association)
+                and then Nkind (Parent (Parent (Parent (Parent (N))))) =
+                                                      N_Component_Definition)
       then
          Rewrite (Pref, Concurrent_Ref (Pref));
          Analyze (Pref);
@@ -690,9 +688,9 @@ package body Exp_Attr is
 
             function Enclosing_Object (N : Node_Id) return Node_Id;
             --  If N denotes a compound name (selected component, indexed
-            --  component, or slice), returns the name of the outermost
-            --  such enclosing object. Otherwise returns N. If the object
-            --  is a renaming, then the renamed object is returned.
+            --  component, or slice), returns the name of the outermost such
+            --  enclosing object. Otherwise returns N. If the object is a
+            --  renaming, then the renamed object is returned.
 
             ----------------------
             -- Enclosing_Object --
index 20790526e9fc07e2bb1c8167b97edf7e1047b5a3..e26734ea40ecbfec3607cbe6d31d038efbadad61 100644 (file)
@@ -7824,8 +7824,8 @@ package body Exp_Ch9 is
                   Oent     : constant Entity_Id := Defining_Identifier (Priv);
                   New_Comp : Node_Id;
                   Nent     : constant Entity_Id :=
-                               Make_Defining_Identifier
-                                 (Sloc (Oent), Chars (Oent));
+                               Make_Defining_Identifier (Sloc (Oent),
+                                 Chars => Chars (Oent));
 
                begin
                   if Present (Subtype_Indication (Old_Comp)) then
@@ -7846,9 +7846,9 @@ package body Exp_Ch9 is
 
                   New_Priv :=
                     Make_Component_Declaration (Loc,
-                      Defining_Identifier => Nent,
+                      Defining_Identifier  => Nent,
                       Component_Definition => New_Comp,
-                      Expression => Expression (Priv));
+                      Expression           => Expression (Priv));
 
                   Set_Has_Per_Object_Constraint (Nent,
                     Has_Per_Object_Constraint (Oent));
index 0483d82724b3f18ac92c08db31add9fadc553275..f9bcf634e5346c3dfb86773b34cf359353fff848 100644 (file)
@@ -2114,6 +2114,7 @@ __gnat_install_handler(void)
 #elif defined(__APPLE__)
 
 #include <signal.h>
+#include <sys/syscall.h>
 #include <mach/mach_vm.h>
 #include <mach/mach_init.h>
 #include <mach/vm_statistics.h>
@@ -2123,9 +2124,9 @@ char __gnat_alternate_stack[32 * 1024]; /* 1 * MINSIGSTKSZ */
 
 static void __gnat_error_handler (int sig, siginfo_t * si, void * uc);
 
-/* Defined in xnu unix_signal.c  */
+/* Defined in xnu unix_signal.c.
+   Tell the kernel to re-use alt stack when delivering a signal.  */
 #define        UC_RESET_ALT_STACK      0x80000000
-extern int sigreturn (void *uc, int flavour);
 
 /* Return true if ADDR is within a stack guard area.  */
 static int
@@ -2173,8 +2174,9 @@ __gnat_error_handler (int sig, siginfo_t * si, void * uc ATTRIBUTE_UNUSED)
          msg = "erroneous memory access";
        }
       /* Reset the use of alt stack, so that the alt stack will be used
-        for the next signal delivery.  */
-      sigreturn (NULL, UC_RESET_ALT_STACK);
+        for the next signal delivery.
+         The stack can't be used in case of stack checking.  */
+      syscall (SYS_sigreturn, NULL, UC_RESET_ALT_STACK);
       break;
 
     case SIGFPE:
index 064cbb69a7b83322458d33a8693498c33359049a..b8d6674cc0e48dd01f9924ed3c9c40e1bf9a599c 100644 (file)
@@ -4712,7 +4712,7 @@ package body Prj.Nmsc is
            (Path_Id         : Name_Id;
             Display_Path_Id : Name_Id);
          --  Add the directory Path_Id to the list of source_dirs if not
-         --  already in the list
+         --  already in the list.
 
          procedure Recursive_Find_Dirs (Path : Name_Id);
          --  Find all the subdirectories (recursively) of Path and add them
@@ -4731,12 +4731,12 @@ package body Prj.Nmsc is
             Rank_List  : Number_List_Index;
             Prev_Rank  : Number_List_Index;
             Element    : String_Element;
+
          begin
             Prev      := Nil_String;
             Prev_Rank := No_Number_List;
             List      := Project.Source_Dirs;
             Rank_List := Project.Source_Dir_Ranks;
-
             while List /= Nil_String loop
                Element := Data.Tree.String_Elements.Table (List);
                exit when Element.Value = Path_Id;
@@ -4782,7 +4782,6 @@ package body Prj.Nmsc is
                     String_Element_Table.Last (Data.Tree.String_Elements);
                   Data.Tree.Number_Lists.Table (Last_Src_Dir_Rank).Next :=
                     Number_List_Table.Last (Data.Tree.Number_Lists);
-
                end if;
 
                --  And register this source directory as the new last
@@ -4796,6 +4795,7 @@ package body Prj.Nmsc is
                  (Number => Rank, Next => No_Number_List);
 
             elsif List /= Nil_String then
+
                --  Remove source dir, if present
 
                if Prev = Nil_String then
@@ -4818,9 +4818,10 @@ package body Prj.Nmsc is
          -------------------------
 
          procedure Recursive_Find_Dirs (Path : Name_Id) is
-            Dir     : Dir_Type;
-            Name    : String (1 .. 250);
-            Last    : Natural;
+            Dir  : Dir_Type;
+            Name : String (1 .. 250);
+            Last : Natural;
+
             Non_Canonical_Path : Name_Id := No_Name;
             Canonical_Path     : Name_Id := No_Name;
 
@@ -4860,9 +4861,9 @@ package body Prj.Nmsc is
               (Path_Id         => Canonical_Path,
                Display_Path_Id => Non_Canonical_Path);
 
-            --  Now look for subdirectories. We do that even when this
-            --  directory is already in the list, because some of its
-            --  subdirectories may not be in the list yet.
+            --  Now look for subdirectories. Do that even when this directory
+            --  is already in the list, because some of its subdirectories may
+            --  not be in the list yet.
 
             Open (Dir, The_Path (The_Path'First .. The_Path_Last));
 
@@ -4882,12 +4883,14 @@ package body Prj.Nmsc is
 
                   declare
                      Path_Name : constant String :=
-                       Normalize_Pathname
-                         (Name      => Name (1 .. Last),
-                          Directory =>
-                            The_Path (The_Path'First .. The_Path_Last),
-                          Resolve_Links  => Opt.Follow_Links_For_Dirs,
-                          Case_Sensitive => True);
+                                   Normalize_Pathname
+                                     (Name           => Name (1 .. Last),
+                                      Directory      =>
+                                        The_Path
+                                          (The_Path'First .. The_Path_Last),
+                                      Resolve_Links  =>
+                                        Opt.Follow_Links_For_Dirs,
+                                      Case_Sensitive => True);
 
                   begin
                      if Is_Directory (Path_Name) then
@@ -5028,13 +5031,14 @@ package body Prj.Nmsc is
 
                else
                   declare
-                     Path              : constant String :=
-                        Normalize_Pathname
-                         (Name           => Get_Name_String (Path_Name.Name),
-                          Directory      =>
-                            Get_Name_String (Project.Directory.Name),
-                          Resolve_Links  => Opt.Follow_Links_For_Dirs,
-                          Case_Sensitive => True);
+                     Path : constant String :=
+                              Normalize_Pathname
+                                (Name           =>
+                                   Get_Name_String (Path_Name.Name),
+                                 Directory      =>
+                                   Get_Name_String (Project.Directory.Name),
+                                 Resolve_Links  => Opt.Follow_Links_For_Dirs,
+                                 Case_Sensitive => True);
 
                      Last_Path         : constant Natural :=
                                            Compute_Directory_Last (Path);
index f1004d5a5c34803aaf549392b5f10f54257bb40c..3da3c611198971a547263dc12e11956b21a8493b 100644 (file)
@@ -668,10 +668,12 @@ package body Tbuild is
          N_Op_Shift_Right_Arithmetic => Name_Shift_Right_Arithmetic);
 
       Nod : constant Node_Id := New_Node (New_Node_Kind, New_Sloc);
+
    begin
       if New_Node_Kind in Name_Of'Range then
          Set_Chars (Nod, Name_Of (New_Node_Kind));
       end if;
+
       return Nod;
    end New_Op_Node;
 
index 7340f64129e92ca9f560788418e36e81b3d1cc8d..cc3603aafa080ed94871d2f995db6b4a03db56a2 100644 (file)
@@ -31,7 +31,7 @@
 
 --  This package contains host independent type definitions which are used
 --  in more than one unit in the compiler. They are gathered here for easy
---  reference, though in some cases the full description is found in the
+--  reference, although in some cases the full description is found in the
 --  relevant module which implements the definition. The main reason that they
 --  are not in their "natural" specs is that this would cause a lot of inter-
 --  spec dependencies, and in particular some awkward circular dependencies