Commit 550f4135 by Arnaud Charlet

[multiple changes]

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