[multiple changes]

2011-08-04  Robert Dewar  <dewar@adacore.com>

	* sem_ch3.adb, make.adb, a-cohata.ads, sem_prag.adb, makeutl.adb,
	lib-xref-alfa.adb: Minor reformatting.

2011-08-04  Marc Sango  <sango@adacore.com>

	* sem_ch12.adb (Analyze_Generic_Package_Declaration,
	Analyze_Generic_Subprogram_Declaration, Analyze_Package_Instantiation,
	Analyze_Subprogram_Instantiation): Check absence of generic in SPARK
	mode.

2011-08-04  Tristan Gingold  <gingold@adacore.com>

	* bindgen.adb (Gen_Adainit_C): Remove.
	(Gen_Adafinal_C): Ditto.
	(Gen_Elab_Externals_C): Ditto.
	(Gen_Elab_Calls_C): Ditto.
	(Gen_Elab_Order_C): Ditto.
	(Gen_Elab_Defs_C): Ditto.
	(Gen_Finalize_Library_C): Ditto.
	(Gen_Finalize_Library_Defs_C): Ditto.
	(Gen_Main_C): Ditto.
	(Gen_Output_File_C): Ditto.
	(Gen_Restrictions_C): Ditto.
	(Gen_Versions_C): Ditto.
	(Write_Info_Ada_C): Ditto.
	(Gen_Object_Files_Options): Call WBI instead of Write_Info_Ada_C
	(Gen_Output_File): Do not force Ada_Bind_File anymore.
	Always call Gen_Output_File_Ada.
	* gnatlink.adb (Begin_Info): Now a constant.
	(End_Info): Ditto.
	(Ada_Bind_File): Remove
	(Process_Args): Do not handle -A/-C.  Remove not Ada_Bind_File cases.
	* switch-b.adb (Scan_Binder_Switches): Do not handle -C.
	* gnatbind.adb (Gnatbind): Remove not Ada_Bind_File cases.
	* opt.ads (Ada_Bind_File): Remove.

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

	* projects.texi: Document target-specific directory in default project
	path for gnatmake.

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

	* gnatls.adb, prj-env.adb: Add $prefix/share/gpr to default project
	path in all cases .

From-SVN: r177395
This commit is contained in:
Arnaud Charlet 2011-08-04 17:18:34 +02:00
parent 84f405a1c1
commit a54d0eb4b0
16 changed files with 141 additions and 1452 deletions

View File

@ -1,3 +1,51 @@
2011-08-04 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb, make.adb, a-cohata.ads, sem_prag.adb, makeutl.adb,
lib-xref-alfa.adb: Minor reformatting.
2011-08-04 Marc Sango <sango@adacore.com>
* sem_ch12.adb (Analyze_Generic_Package_Declaration,
Analyze_Generic_Subprogram_Declaration, Analyze_Package_Instantiation,
Analyze_Subprogram_Instantiation): Check absence of generic in SPARK
mode.
2011-08-04 Tristan Gingold <gingold@adacore.com>
* bindgen.adb (Gen_Adainit_C): Remove.
(Gen_Adafinal_C): Ditto.
(Gen_Elab_Externals_C): Ditto.
(Gen_Elab_Calls_C): Ditto.
(Gen_Elab_Order_C): Ditto.
(Gen_Elab_Defs_C): Ditto.
(Gen_Finalize_Library_C): Ditto.
(Gen_Finalize_Library_Defs_C): Ditto.
(Gen_Main_C): Ditto.
(Gen_Output_File_C): Ditto.
(Gen_Restrictions_C): Ditto.
(Gen_Versions_C): Ditto.
(Write_Info_Ada_C): Ditto.
(Gen_Object_Files_Options): Call WBI instead of Write_Info_Ada_C
(Gen_Output_File): Do not force Ada_Bind_File anymore.
Always call Gen_Output_File_Ada.
* gnatlink.adb (Begin_Info): Now a constant.
(End_Info): Ditto.
(Ada_Bind_File): Remove
(Process_Args): Do not handle -A/-C. Remove not Ada_Bind_File cases.
* switch-b.adb (Scan_Binder_Switches): Do not handle -C.
* gnatbind.adb (Gnatbind): Remove not Ada_Bind_File cases.
* opt.ads (Ada_Bind_File): Remove.
2011-08-04 Thomas Quinot <quinot@adacore.com>
* projects.texi: Document target-specific directory in default project
path for gnatmake.
2011-08-04 Thomas Quinot <quinot@adacore.com>
* gnatls.adb, prj-env.adb: Add $prefix/share/gpr to default project
path in all cases .
2011-08-04 Yannick Moy <moy@adacore.com>
* sem_ch3.adb, sem_ch5.adb, sem_util.adb, sem_ch4.adb, sem_ch8.adb,

View File

@ -31,7 +31,8 @@
-- containers.
package Ada.Containers.Hash_Tables is
pragma Pure; -- so this can be imported by Remote_Types packages
pragma Pure;
-- Declare Pure so this can be imported by Remote_Types packages
generic
type Node_Type (<>) is limited private;
@ -42,13 +43,14 @@ package Ada.Containers.Hash_Tables is
type Buckets_Type is array (Hash_Type range <>) of Node_Access;
type Buckets_Access is access all Buckets_Type;
for Buckets_Access'Storage_Size use 0; -- so this package can be Pure
for Buckets_Access'Storage_Size use 0;
-- Storage_Size of zero so this package can be Pure
type Hash_Table_Type is tagged record
Buckets : Buckets_Access;
Length : Count_Type := 0;
Busy : Natural := 0;
Lock : Natural := 0;
Busy : Natural := 0;
Lock : Natural := 0;
end record;
end Generic_Hash_Table_Types;
@ -62,11 +64,11 @@ package Ada.Containers.Hash_Tables is
(Capacity : Count_Type;
Modulus : Hash_Type) is
tagged record
Length : Count_Type := 0;
Busy : Natural := 0;
Lock : Natural := 0;
Free : Count_Type'Base := -1;
Nodes : Nodes_Type (1 .. Capacity) := (others => <>);
Length : Count_Type := 0;
Busy : Natural := 0;
Lock : Natural := 0;
Free : Count_Type'Base := -1;
Nodes : Nodes_Type (1 .. Capacity) := (others => <>);
Buckets : Buckets_Type (1 .. Modulus) := (others => 0);
end record;
end Generic_Bounded_Hash_Table_Types;

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@ -568,20 +568,12 @@ begin
Last : constant Natural := Output_File_Name'Last;
begin
if Ada_Bind_File then
if Length <= 4
or else Output_File_Name (Last - 3 .. Last) /= ".adb"
then
Fail ("output file name should have .adb extension");
end if;
else
if Length <= 2
or else Output_File_Name (Last - 1 .. Last) /= ".c"
then
Fail ("output file name should have .c extension");
end if;
if Length <= 4
or else Output_File_Name (Last - 3 .. Last) /= ".adb"
then
Fail ("output file name should have .adb extension");
end if;
end Check_Extensions;
end if;

View File

@ -141,9 +141,8 @@ procedure Gnatlink is
Read_Mode : constant String := "r" & ASCII.NUL;
Begin_Info : String := "-- BEGIN Object file/option list";
End_Info : String := "-- END Object file/option list ";
-- Note: above lines are modified in C mode, see option processing
Begin_Info : constant String := "-- BEGIN Object file/option list";
End_Info : constant String := "-- END Object file/option list ";
Gcc_Path : String_Access;
Linker_Path : String_Access;
@ -163,9 +162,6 @@ procedure Gnatlink is
Verbose_Mode : Boolean := False;
Very_Verbose_Mode : Boolean := False;
Ada_Bind_File : Boolean := True;
-- Set to True if bind file is generated in Ada
Standard_Gcc : Boolean := True;
Compile_Bind_File : Boolean := True;
@ -413,11 +409,6 @@ procedure Gnatlink is
elsif Arg'Length = 2 then
case Arg (2) is
when 'A' =>
Ada_Bind_File := True;
Begin_Info := "-- BEGIN Object file/option list";
End_Info := "-- END Object file/option list ";
when 'b' =>
Linker_Options.Increment_Last;
Linker_Options.Table (Linker_Options.Last) :=
@ -448,11 +439,6 @@ procedure Gnatlink is
end Get_Machine_Name;
when 'C' =>
Ada_Bind_File := False;
Begin_Info := "/* BEGIN Object file/option list";
End_Info := " END Object file/option list */";
when 'f' =>
if Object_List_File_Supported then
Object_List_File_Required := True;
@ -663,13 +649,11 @@ procedure Gnatlink is
Next_Arg := Next_Arg + 1;
end loop;
-- If Ada bind file, then compile it with warnings suppressed, because
-- Compile the bind file with warnings suppressed, because
-- otherwise the with of the main program may cause junk warnings.
if Ada_Bind_File then
Binder_Options.Increment_Last;
Binder_Options.Table (Binder_Options.Last) := new String'("-gnatws");
end if;
Binder_Options.Increment_Last;
Binder_Options.Table (Binder_Options.Last) := new String'("-gnatws");
-- If we did not get an ali file at all, and we had at least one
-- linker option, then assume that was the intended ali file after
@ -937,11 +921,8 @@ procedure Gnatlink is
exit when Next_Line (Nfirst .. Nlast) = End_Info;
if Ada_Bind_File then
Next_Line (Nfirst .. Nlast - 8) :=
Next_Line (Nfirst + 8 .. Nlast);
Nlast := Nlast - 8;
end if;
Next_Line (Nfirst .. Nlast - 8) := Next_Line (Nfirst + 8 .. Nlast);
Nlast := Nlast - 8;
-- Go to next section when switches are reached
@ -1413,11 +1394,8 @@ procedure Gnatlink is
Get_Next_Line;
exit when Next_Line (Nfirst .. Nlast) = End_Info;
if Ada_Bind_File then
Next_Line (Nfirst .. Nlast - 8) :=
Next_Line (Nfirst + 8 .. Nlast);
Nlast := Nlast - 8;
end if;
Next_Line (Nfirst .. Nlast - 8) := Next_Line (Nfirst + 8 .. Nlast);
Nlast := Nlast - 8;
end loop;
end if;
@ -1611,12 +1589,10 @@ begin
elsif Arg'Length > 5
and then Arg (Arg'First + 2 .. Arg'First + 5) = "RTS="
then
if Ada_Bind_File then
Binder_Options_From_ALI.Increment_Last;
Binder_Options_From_ALI.Table
(Binder_Options_From_ALI.Last)
:= String_Access (Arg);
end if;
Binder_Options_From_ALI.Increment_Last;
Binder_Options_From_ALI.Table
(Binder_Options_From_ALI.Last)
:= String_Access (Arg);
-- Set the RTS_*_Path_Name variables, so that
-- the correct directories will be set when
@ -1666,14 +1642,9 @@ begin
when CLI_Target => Gcc := new String'("dotnet-gnatcompile");
when No_VM => raise Program_Error;
end case;
Ada_Bind_File := True;
Begin_Info := "-- BEGIN Object file/option list";
End_Info := "-- END Object file/option list ";
end if;
-- If the main program is in Ada it is compiled with the following
-- switches:
-- Compile the bind file with the following switches:
-- -gnatA stops reading gnat.adc, since we don't know what
-- pragmas would work, and we do not need it anyway.
@ -1686,22 +1657,20 @@ begin
-- In addition, in CodePeer mode compile with -gnatC
if Ada_Bind_File then
Binder_Options_From_ALI.Increment_Last;
Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
Binder_Options_From_ALI.Increment_Last;
Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
new String'("-gnatA");
Binder_Options_From_ALI.Increment_Last;
Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
Binder_Options_From_ALI.Increment_Last;
Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
new String'("-gnatWb");
Binder_Options_From_ALI.Increment_Last;
Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
Binder_Options_From_ALI.Increment_Last;
Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
new String'("-gnatiw");
if Opt.CodePeer_Mode then
Binder_Options_From_ALI.Increment_Last;
Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
if Opt.CodePeer_Mode then
Binder_Options_From_ALI.Increment_Last;
Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
new String'("-gnatC");
end if;
end if;
-- Locate all the necessary programs and verify required files are present
@ -1814,9 +1783,7 @@ begin
begin
-- Set prefix
if not Ada_Bind_File then
Bind_File_Prefix := new String'("b_");
elsif OpenVMS_On_Target then
if OpenVMS_On_Target then
Bind_File_Prefix := new String'("b__");
else
Bind_File_Prefix := new String'("b~");
@ -1839,13 +1806,9 @@ begin
Fname (Fname'First .. Fname'First + Fname_Len - 1);
begin
if Ada_Bind_File then
Binder_Spec_Src_File := new String'(Fnam & ".ads");
Binder_Body_Src_File := new String'(Fnam & ".adb");
Binder_Ali_File := new String'(Fnam & ".ali");
else
Binder_Body_Src_File := new String'(Fnam & ".c");
end if;
Binder_Spec_Src_File := new String'(Fnam & ".ads");
Binder_Body_Src_File := new String'(Fnam & ".adb");
Binder_Ali_File := new String'(Fnam & ".ali");
Binder_Obj_File := new String'(Fnam & Get_Target_Object_Suffix.all);
end;
@ -2272,14 +2235,8 @@ begin
-- useful if debugging.
if not Debug_Flag_Present then
if Binder_Ali_File /= null then
Delete (Binder_Ali_File.all & ASCII.NUL);
end if;
if Binder_Spec_Src_File /= null then
Delete (Binder_Spec_Src_File.all & ASCII.NUL);
end if;
Delete (Binder_Ali_File.all & ASCII.NUL);
Delete (Binder_Spec_Src_File.all & ASCII.NUL);
Delete (Binder_Body_Src_File.all & ASCII.NUL);
if VM_Target = No_VM then

View File

@ -1720,12 +1720,20 @@ begin
Write_Line
(To_Host_Dir_Spec (Name_Buffer (1 .. Name_Len), True).all);
Name_Len := Prefix_Name_Len;
Add_Str_To_Name_Buffer ("share" & Directory_Separator
& "gpr" & Directory_Separator);
Write_Str (" ");
Write_Line
(To_Host_Dir_Spec (Name_Buffer (1 .. Name_Len), True).all);
Name_Len := Prefix_Name_Len;
Add_Str_To_Name_Buffer ("lib" & Directory_Separator
& "gnat" & Directory_Separator);
Write_Str (" ");
Write_Line
(To_Host_Dir_Spec (Name_Buffer (1 .. Name_Len), True).all);
end if;
end if;
end;

View File

@ -550,9 +550,9 @@ package body ALFA is
and then Ekind_In (Scope (E), E_Package, E_Package_Body);
end Is_Global_Constant;
-- Start of processing for Eliminate_Before_Sort
begin
-- Start of processing for Eliminate_Before_Sort
begin
NR := Nrefs;
Nrefs := 0;

View File

@ -4359,8 +4359,8 @@ package body Make is
end if;
end if;
-- Put the object directories in ADA_OBJECTS_PATH
-- Ditto for source directories in ADA_INCLUDE_PATH in CodePeer mode
-- Put the object directories in ADA_OBJECTS_PATH. Same treatment for
-- source directories in ADA_INCLUDE_PATH if in CodePeer mode.
Prj.Env.Set_Ada_Paths
(Main_Project,

View File

@ -1389,12 +1389,12 @@ package body Makeutl is
if Name_Len > Base_Main'Length
and then Name_Buffer (1 .. Base_Main'Length) = Base_Main
then
Suffix :=
Source.Language.Config.Naming_Data.Spec_Suffix;
Suffix := Source.Language.Config.Naming_Data.Spec_Suffix;
if Suffix /= No_File then
declare
Suffix_Str : String := Get_Name_String (Suffix);
begin
Canonical_Case_File_Name (Suffix_Str);

View File

@ -112,10 +112,6 @@ package Opt is
-- case of some binder variables, Gnatbind.Scan_Bind_Arg may modify
-- the default values.
Ada_Bind_File : Boolean := True;
-- GNATBIND, GNATLINK
-- Set True if binder file to be generated in Ada rather than C
type Ada_Version_Type is (Ada_83, Ada_95, Ada_2005, Ada_2012);
pragma Ordered (Ada_Version_Type);
-- Versions of Ada for Ada_Version below. Note that these are ordered,

View File

@ -1982,7 +1982,6 @@ package body Prj.Env is
if Add_Default_Dir then
declare
Prefix : String_Ptr;
Add_Prefix_Share_Gpr : Boolean;
begin
if Sdefault.Search_Dir_Prefix = null then
@ -1990,7 +1989,6 @@ package body Prj.Env is
-- gprbuild case
Prefix := new String'(Executable_Prefix_Path);
Add_Prefix_Share_Gpr := True;
else
Prefix := new String'(Sdefault.Search_Dir_Prefix.all
@ -1998,7 +1996,6 @@ package body Prj.Env is
& ".." & Dir_Separator
& ".." & Dir_Separator
& ".." & Dir_Separator);
Add_Prefix_Share_Gpr := False;
end if;
if Prefix.all /= "" then
@ -2021,14 +2018,11 @@ package body Prj.Env is
("lib" & Directory_Separator & "gnat");
end if;
if Add_Prefix_Share_Gpr then
-- $prefix/share/gpr
-- $prefix/share/gpr
Add_Str_To_Name_Buffer
(Path_Separator & Prefix.all &
"share" & Directory_Separator & "gpr");
end if;
Add_Str_To_Name_Buffer
(Path_Separator & Prefix.all &
"share" & Directory_Separator & "gpr");
-- $prefix/lib/gnat

View File

@ -1135,7 +1135,8 @@ the search stops:
@itemize @bullet
@item @file{<prefix>/<target>/lib/gnat}
(for @command{gprbuild} only and if option @option{--target} is specified)
(for @command{gnatmake} in all cases, and for @command{gprbuild} if option
@option{--target} is specified)
@item @file{<prefix>/share/gpr/}
(for @command{gnatmake} and @command{gprbuild})
@item @file{<prefix>/lib/gnat/}

View File

@ -2690,6 +2690,8 @@ package body Sem_Ch12 is
Decl : Node_Id;
begin
Check_SPARK_Restriction ("generic is not allowed", N);
-- We introduce a renaming of the enclosing package, to have a usable
-- entity as the prefix of an expanded name for a local entity of the
-- form Par.P.Q, where P is the generic package. This is because a local
@ -2811,6 +2813,8 @@ package body Sem_Ch12 is
Typ : Entity_Id;
begin
Check_SPARK_Restriction ("generic is not allowed", N);
-- Create copy of generic unit, and save for instantiation. If the unit
-- is a child unit, do not copy the specifications for the parent, which
-- are not part of the generic tree.
@ -3051,6 +3055,8 @@ package body Sem_Ch12 is
-- Start of processing for Analyze_Package_Instantiation
begin
Check_SPARK_Restriction ("generic is not allowed", N);
-- Very first thing: apply the special kludge for Text_IO processing
-- in case we are instantiating one of the children of [Wide_]Text_IO.
@ -4195,6 +4201,8 @@ package body Sem_Ch12 is
-- Start of processing for Analyze_Subprogram_Instantiation
begin
Check_SPARK_Restriction ("generic is not allowed", N);
-- Very first thing: apply the special kludge for Text_IO processing
-- in case we are instantiating one of the children of [Wide_]Text_IO.
-- Of course such an instantiation is bogus (these are packages, not

View File

@ -2064,14 +2064,14 @@ package body Sem_Ch3 is
D := First (L);
while Present (D) loop
-- Package specification cannot contain a package declaration in
-- SPARK.
-- Package spec cannot contain a package declaration in SPARK
if Nkind (D) = N_Package_Declaration
and then Nkind (Parent (L)) = N_Package_Specification
then
Check_SPARK_Restriction ("package specification cannot contain "
& "a package declaration", D);
Check_SPARK_Restriction
("package specification cannot contain a package declaration",
D);
end if;
-- Complete analysis of declaration

View File

@ -422,9 +422,7 @@ package body Sem_Prag is
-- Checks that the given argument has an identifier, and if so, requires
-- it to match one of the given identifier names. If there is no
-- identifier, or a non-matching identifier, then an error message is
-- given and Pragma_Exit is raised. This checks the optional identifier
-- of a pragma argument, not the argument itself like
-- Check_Arg_Is_One_Of does.
-- given and Pragma_Exit is raised.
procedure Check_In_Main_Program;
-- Common checks for pragmas that appear within a main program
@ -13247,18 +13245,20 @@ package body Sem_Prag is
-- Test_Case --
---------------
-- pragma Test_Case ([Name =>] static_string_EXPRESSION
-- ,[Mode =>] (Normal | Robustness)
-- pragma Test_Case ([Name =>] Static_String_EXPRESSION
-- ,[Mode =>] MODE_TYPE
-- [, Requires => Boolean_EXPRESSION]
-- [, Ensures => Boolean_EXPRESSION]);
-- MODE_TYPE ::= Normal | Robustness
when Pragma_Test_Case => Test_Case : declare
begin
GNAT_Pragma;
Check_At_Least_N_Arguments (3);
Check_At_Most_N_Arguments (4);
Check_Arg_Order
((Name_Name, Name_Mode, Name_Requires, Name_Ensures));
((Name_Name, Name_Mode, Name_Requires, Name_Ensures));
Check_Optional_Identifier (Arg1, Name_Name);
Check_Arg_Is_Static_Expression (Arg1, Standard_String);

View File

@ -26,7 +26,6 @@
with Debug; use Debug;
with Osint; use Osint;
with Opt; use Opt;
with Output; use Output;
with System.WCh_Con; use System.WCh_Con;
@ -166,14 +165,6 @@ package body Switch.B is
Ptr := Ptr + 1;
Check_Only := True;
-- Processing for C switch
when 'C' =>
Ptr := Ptr + 1;
Ada_Bind_File := False;
Write_Line ("warning: gnatbind switch -C is obsolescent");
-- Processing for d switch
when 'd' =>