Commit 24c34107 by Arnaud Charlet

[multiple changes]

2011-08-31  Pascal Obry  <obry@adacore.com>

	* a-direct.adb: Do not try to create an UNC path on Windows.
	(Create_Path): Skip leading computer name in UNC path if any.

2011-08-31  Hristian Kirtchev  <kirtchev@adacore.com>

	* exp_strm.adb (Build_Record_Or_Elementary_Input_Function): Remove the
	version-dependent generation of the return statement. The Ada 2005 tree
	is now the default.

2011-08-31  Thomas Quinot  <quinot@adacore.com>

	* rtsfind.ads, exp_dist.adb (Find_Numeric_Representation): Predefined
	types Stream_Element_Offset and Storage_Offset have a different native
	type depending on whether the platform is 32 or 64 bits. When
	exchanging them, always convert to 64 bits.

2011-08-31  Yannick Moy  <moy@adacore.com>

	* debug.adb: Reserve debug option -gnatd.E for passing gnatprove option
	--force-alfa to gnat2why.

2011-08-31  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch12.adb (Save_References): If the node has aspects, save
	references within the corresponding expressions in a separate step,
	because the aspects are not directly in the tree for the declaration
	to which they belong.

2011-08-31  Arnaud Charlet  <charlet@adacore.com>

	* freeze.adb (Freeze_Record_Type): Omit test on variable size component
	in CodePeer mode, since representation clauses are partially ignored.
	* gcc-interface/Make-lang.in: Update dependencies.

From-SVN: r178373
parent 702d2020
2011-08-31 Pascal Obry <obry@adacore.com>
* a-direct.adb: Do not try to create an UNC path on Windows.
(Create_Path): Skip leading computer name in UNC path if any.
2011-08-31 Hristian Kirtchev <kirtchev@adacore.com>
* exp_strm.adb (Build_Record_Or_Elementary_Input_Function): Remove the
version-dependent generation of the return statement. The Ada 2005 tree
is now the default.
2011-08-31 Thomas Quinot <quinot@adacore.com>
* rtsfind.ads, exp_dist.adb (Find_Numeric_Representation): Predefined
types Stream_Element_Offset and Storage_Offset have a different native
type depending on whether the platform is 32 or 64 bits. When
exchanging them, always convert to 64 bits.
2011-08-31 Yannick Moy <moy@adacore.com>
* debug.adb: Reserve debug option -gnatd.E for passing gnatprove option
--force-alfa to gnat2why.
2011-08-31 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Save_References): If the node has aspects, save
references within the corresponding expressions in a separate step,
because the aspects are not directly in the tree for the declaration
to which they belong.
2011-08-31 Arnaud Charlet <charlet@adacore.com>
* freeze.adb (Freeze_Record_Type): Omit test on variable size component
in CodePeer mode, since representation clauses are partially ignored.
* gcc-interface/Make-lang.in: Update dependencies.
2011-08-31 Jose Ruiz <ruiz@adacore.com> 2011-08-31 Jose Ruiz <ruiz@adacore.com>
* s-taprop-vxworks.adb, s-taprop-mingw.adb, s-taprop-linux.adb, * s-taprop-vxworks.adb, s-taprop-mingw.adb, s-taprop-linux.adb,
......
...@@ -435,6 +435,7 @@ package body Ada.Directories is ...@@ -435,6 +435,7 @@ package body Ada.Directories is
New_Dir : String (1 .. New_Directory'Length + 1); New_Dir : String (1 .. New_Directory'Length + 1);
Last : Positive := 1; Last : Positive := 1;
Start : Positive := 1;
begin begin
-- First, the invalid case -- First, the invalid case
...@@ -450,9 +451,24 @@ package body Ada.Directories is ...@@ -450,9 +451,24 @@ package body Ada.Directories is
New_Dir (1 .. New_Directory'Length) := New_Directory; New_Dir (1 .. New_Directory'Length) := New_Directory;
New_Dir (New_Dir'Last) := Directory_Separator; New_Dir (New_Dir'Last) := Directory_Separator;
if Directory_Separator = '\'
and then New_Dir'Length > 2
and then Is_In (New_Dir (1), Dir_Seps)
and then Is_In (New_Dir (2), Dir_Seps)
then
Start := 2;
-- If the first two characters are directory separators and host
-- is windows, we have an UNC path. Skip it.
loop
Start := Start + 1;
exit when Start = New_Dir'Last
or else Is_In (New_Dir (Start), Dir_Seps);
end loop;
end if;
-- Create, if necessary, each directory in the path -- Create, if necessary, each directory in the path
for J in 2 .. New_Dir'Last loop for J in Start + 1 .. New_Dir'Last loop
-- Look for the end of an intermediate directory -- Look for the end of an intermediate directory
......
...@@ -122,7 +122,7 @@ package body Debug is ...@@ -122,7 +122,7 @@ package body Debug is
-- d.B -- d.B
-- d.C Generate concatenation call, do not generate inline code -- d.C Generate concatenation call, do not generate inline code
-- d.D -- d.D
-- d.E -- d.E Force Alfa mode for gnat2why
-- d.F Alfa mode -- d.F Alfa mode
-- d.G Precondition only mode for gnat2why -- d.G Precondition only mode for gnat2why
-- d.H Standard package only mode for gnat2why -- d.H Standard package only mode for gnat2why
...@@ -580,6 +580,10 @@ package body Debug is ...@@ -580,6 +580,10 @@ package body Debug is
-- d.C Generate call to System.Concat_n.Str_Concat_n routines in cases -- d.C Generate call to System.Concat_n.Str_Concat_n routines in cases
-- where we would normally generate inline concatenation code. -- where we would normally generate inline concatenation code.
-- d.E Force Alfa mode for gnat2why. In this mode, errors are issued for
-- all violations of Alfa in user code, and warnings are issued for
-- constructs not yet implemented in gnat2why.
-- d.F Alfa mode. Generate AST in a form suitable for formal verification, -- d.F Alfa mode. Generate AST in a form suitable for formal verification,
-- as well as additional cross reference information in ALI files to -- as well as additional cross reference information in ALI files to
-- compute effects of subprograms. -- compute effects of subprograms.
......
...@@ -10842,6 +10842,15 @@ package body Exp_Dist is ...@@ -10842,6 +10842,15 @@ package body Exp_Dist is
P_Size : constant Uint := Esize (FST); P_Size : constant Uint := Esize (FST);
begin begin
-- Special case: for Stream_Element_Offset and Storage_Offset,
-- always force transmission as a 64-bit value.
if Is_RTE (FST, RE_Stream_Element_Offset)
or else Is_RTE (FST, RE_Storage_Offset)
then
return RTE (RE_Unsigned_64);
end if;
if Is_Unsigned_Type (Typ) then if Is_Unsigned_Type (Typ) then
if P_Size <= 8 then if P_Size <= 8 then
return RTE (RE_Unsigned_8); return RTE (RE_Unsigned_8);
......
...@@ -1120,13 +1120,13 @@ package body Exp_Strm is ...@@ -1120,13 +1120,13 @@ package body Exp_Strm is
Fnam : out Entity_Id) Fnam : out Entity_Id)
is is
Cn : Name_Id; Cn : Name_Id;
J : Pos;
Decls : List_Id;
Constr : List_Id; Constr : List_Id;
Obj_Decl : Node_Id; Decls : List_Id;
Stms : List_Id;
Discr : Entity_Id; Discr : Entity_Id;
J : Pos;
Obj_Decl : Node_Id;
Odef : Node_Id; Odef : Node_Id;
Stms : List_Id;
begin begin
Decls := New_List; Decls := New_List;
...@@ -1183,12 +1183,10 @@ package body Exp_Strm is ...@@ -1183,12 +1183,10 @@ package body Exp_Strm is
Odef := New_Occurrence_Of (Typ, Loc); Odef := New_Occurrence_Of (Typ, Loc);
end if; end if;
-- For Ada 2005 we create an extended return statement encapsulating -- Create an extended return statement encapsulating the result object
-- the result object and 'Read call, which is needed in general for -- and 'Read call, which is needed in general for proper handling of
-- proper handling of build-in-place results (such as when the result -- build-in-place results (such as when the result type is inherently
-- type is inherently limited). -- limited).
-- Perhaps we should just generate an extended return in all cases???
Obj_Decl := Obj_Decl :=
Make_Object_Declaration (Loc, Make_Object_Declaration (Loc,
...@@ -1203,33 +1201,18 @@ package body Exp_Strm is ...@@ -1203,33 +1201,18 @@ package body Exp_Strm is
Set_No_Initialization (Obj_Decl); Set_No_Initialization (Obj_Decl);
end if; end if;
if Ada_Version >= Ada_2005 then Stms := New_List (
Stms := New_List ( Make_Extended_Return_Statement (Loc,
Make_Extended_Return_Statement (Loc, Return_Object_Declarations => New_List (Obj_Decl),
Return_Object_Declarations => New_List (Obj_Decl), Handled_Statement_Sequence =>
Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc,
Make_Handled_Sequence_Of_Statements (Loc, Statements => New_List (
Statements => New_List ( Make_Attribute_Reference (Loc,
Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Typ, Loc),
Prefix => New_Occurrence_Of (Typ, Loc), Attribute_Name => Name_Read,
Attribute_Name => Name_Read, Expressions => New_List (
Expressions => New_List ( Make_Identifier (Loc, Name_S),
Make_Identifier (Loc, Name_S), Make_Identifier (Loc, Name_V)))))));
Make_Identifier (Loc, Name_V)))))));
else
Append_To (Decls, Obj_Decl);
Stms := New_List (
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Typ, Loc),
Attribute_Name => Name_Read,
Expressions => New_List (
Make_Identifier (Loc, Name_S),
Make_Identifier (Loc, Name_V))),
Make_Simple_Return_Statement (Loc,
Expression => Make_Identifier (Loc, Name_V)));
end if;
Fnam := Make_Stream_Subprogram_Name (Loc, Typ, TSS_Stream_Input); Fnam := Make_Stream_Subprogram_Name (Loc, Typ, TSS_Stream_Input);
......
...@@ -1839,6 +1839,8 @@ package body Freeze is ...@@ -1839,6 +1839,8 @@ package body Freeze is
-- since the component type has to be frozen for us to know -- since the component type has to be frozen for us to know
-- if it is variable length. We omit this test in a generic -- if it is variable length. We omit this test in a generic
-- context, it will be applied at instantiation time. -- context, it will be applied at instantiation time.
-- We also omit this test in CodePeer mode, since we do not
-- have sufficient info on size and representation clauses.
if Present (CC) then if Present (CC) then
Placed_Component := True; Placed_Component := True;
...@@ -1846,6 +1848,9 @@ package body Freeze is ...@@ -1846,6 +1848,9 @@ package body Freeze is
if Inside_A_Generic then if Inside_A_Generic then
null; null;
elsif CodePeer_Mode then
null;
elsif not elsif not
Size_Known_At_Compile_Time Size_Known_At_Compile_Time
(Underlying_Type (Etype (Comp))) (Underlying_Type (Etype (Comp)))
......
...@@ -555,6 +555,7 @@ package Rtsfind is ...@@ -555,6 +555,7 @@ package Rtsfind is
RE_Root_Stream_Type, -- Ada.Streams RE_Root_Stream_Type, -- Ada.Streams
RE_Stream_Element, -- Ada.Streams RE_Stream_Element, -- Ada.Streams
RE_Stream_Element_Offset, -- Ada.Streams
RE_Stream_Access, -- Ada.Streams.Stream_IO RE_Stream_Access, -- Ada.Streams.Stream_IO
...@@ -1748,6 +1749,7 @@ package Rtsfind is ...@@ -1748,6 +1749,7 @@ package Rtsfind is
RE_Root_Stream_Type => Ada_Streams, RE_Root_Stream_Type => Ada_Streams,
RE_Stream_Element => Ada_Streams, RE_Stream_Element => Ada_Streams,
RE_Stream_Element_Offset => Ada_Streams,
RE_Stream_Access => Ada_Streams_Stream_IO, RE_Stream_Access => Ada_Streams_Stream_IO,
......
...@@ -12737,6 +12737,23 @@ package body Sem_Ch12 is ...@@ -12737,6 +12737,23 @@ package body Sem_Ch12 is
end if; end if;
end; end;
end if; end if;
-- If a node has aspects, references within their expressions must
-- be saved separately, given that they are not directly in the
-- tree.
if Has_Aspects (N) then
declare
Aspect : Node_Id;
begin
Aspect := First (Aspect_Specifications (N));
while Present (Aspect) loop
Save_Global_References (Expression (Aspect));
Next (Aspect);
end loop;
end;
end if;
end Save_References; end Save_References;
-- Start of processing for Save_Global_References -- Start of processing for Save_Global_References
......
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