+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
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
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);
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 --
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
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));
#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>
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
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:
(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
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;
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
(Number => Rank, Next => No_Number_List);
elsif List /= Nil_String then
+
-- Remove source dir, if present
if Prev = Nil_String then
-------------------------
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;
(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));
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
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);
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;
-- 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