Commit 92966893 by Arnaud Charlet

[multiple changes]

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

	* make.adb (Do_Codepeer_Globalize_Step): Removed. Use CodePeer_Mode
	instead.
	(CodePeer_Mode_String): New.
	(Linking_Phase, Binding_Phase): Call gnatlink with -P switch in
	CodePeer mode.
	(Scan_Make_Arg): Do not disable binding/linking phase in CodePeer mode.
	* bindgen.adb (Gen_Elab_Calls_Ada): Ignore subprograms in CodePeer
	mode, since no useful elaboration subprogram is needed by CodePeer.
	* gnatlink.adb (Gnatlink): Add support for -P switch (CodePeer mode).
	In this mode, compile binder file with -gnatC and do stop after this
	step.

2011-08-04  Vincent Celier  <celier@adacore.com>

	* exp_ch7.adb: Minor comment fix.

From-SVN: r177366
parent 5969611f
2011-08-04 Arnaud Charlet <charlet@adacore.com>
* make.adb (Do_Codepeer_Globalize_Step): Removed. Use CodePeer_Mode
instead.
(CodePeer_Mode_String): New.
(Linking_Phase, Binding_Phase): Call gnatlink with -P switch in
CodePeer mode.
(Scan_Make_Arg): Do not disable binding/linking phase in CodePeer mode.
* bindgen.adb (Gen_Elab_Calls_Ada): Ignore subprograms in CodePeer
mode, since no useful elaboration subprogram is needed by CodePeer.
* gnatlink.adb (Gnatlink): Add support for -P switch (CodePeer mode).
In this mode, compile binder file with -gnatC and do stop after this
step.
2011-08-04 Vincent Celier <celier@adacore.com>
* exp_ch7.adb: Minor comment fix.
2011-08-04 Robert Dewar <dewar@adacore.com> 2011-08-04 Robert Dewar <dewar@adacore.com>
* exp_ch7.adb, make.adb, sem_ch10.adb, bindgen.adb, sem_res.adb, * exp_ch7.adb, make.adb, sem_ch10.adb, bindgen.adb, sem_res.adb,
......
...@@ -1423,7 +1423,10 @@ package body Bindgen is ...@@ -1423,7 +1423,10 @@ package body Bindgen is
-- The uname_E increment is skipped if this is a separate spec, -- The uname_E increment is skipped if this is a separate spec,
-- since it will be done when we process the body. -- since it will be done when we process the body.
else -- Ignore subprograms in CodePeer mode, since no useful
-- elaboration subprogram is needed by CodePeer.
elsif U.Unit_Kind /= 's' or else not CodePeer_Mode then
if Force_Checking_Of_Elaboration_Flags if Force_Checking_Of_Elaboration_Flags
or Interface_Library_Unit or Interface_Library_Unit
or not Bind_Main_Program or not Bind_Main_Program
......
...@@ -4079,7 +4079,7 @@ package body Exp_Ch7 is ...@@ -4079,7 +4079,7 @@ package body Exp_Ch7 is
function Get_Global_Pool_For_Access_Type (T : Entity_Id) return Entity_Id is function Get_Global_Pool_For_Access_Type (T : Entity_Id) return Entity_Id is
begin begin
-- Access types whose size is smaller than System.Address size can -- Access types whose size is smaller than System.Address size can
-- exit only on VMS. We can't use the usual global pool which returns -- exist only on VMS. We can't use the usual global pool which returns
-- an object of type Address as truncation will make it invalid. -- an object of type Address as truncation will make it invalid.
-- To handle this case, VMS has a dedicated global pool that returns -- To handle this case, VMS has a dedicated global pool that returns
-- addresses that fit into 32 bit accesses. -- addresses that fit into 32 bit accesses.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1996-2010, Free Software Foundation, Inc. -- -- Copyright (C) 1996-2011, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -479,6 +479,9 @@ procedure Gnatlink is ...@@ -479,6 +479,9 @@ procedure Gnatlink is
(Argument (Next_Arg), (Argument (Next_Arg),
Only_If_No_Suffix => True)); Only_If_No_Suffix => True));
when 'P' =>
Opt.CodePeer_Mode := True;
when 'R' => when 'R' =>
Opt.Run_Path_Option := False; Opt.Run_Path_Option := False;
...@@ -1441,12 +1444,13 @@ procedure Gnatlink is ...@@ -1441,12 +1444,13 @@ procedure Gnatlink is
Write_Eol; Write_Eol;
Write_Line (" mainprog.ali the ALI file of the main program"); Write_Line (" mainprog.ali the ALI file of the main program");
Write_Eol; Write_Eol;
Write_Line (" -f force object file list to be generated"); Write_Line (" -f Force object file list to be generated");
Write_Line (" -g Compile binder source file with debug information"); Write_Line (" -g Compile binder source file with debug information");
Write_Line (" -n Do not compile the binder source file"); Write_Line (" -n Do not compile the binder source file");
Write_Line (" -P Process files for use by CodePeer");
Write_Line (" -R Do not use a run_path_option"); Write_Line (" -R Do not use a run_path_option");
Write_Line (" -v verbose mode"); Write_Line (" -v Verbose mode");
Write_Line (" -v -v very verbose mode"); Write_Line (" -v -v Very verbose mode");
Write_Eol; Write_Eol;
Write_Line (" -o nam Use 'nam' as the name of the executable"); Write_Line (" -o nam Use 'nam' as the name of the executable");
Write_Line (" -b target Compile the binder source to run on target"); Write_Line (" -b target Compile the binder source to run on target");
...@@ -1675,6 +1679,8 @@ begin ...@@ -1675,6 +1679,8 @@ begin
-- because bindgen uses brackets encoding for all upper -- because bindgen uses brackets encoding for all upper
-- half and wide characters in identifier names. -- half and wide characters in identifier names.
-- In addition, in CodePeer mode compile with -gnatC
if Ada_Bind_File then if Ada_Bind_File then
Binder_Options_From_ALI.Increment_Last; Binder_Options_From_ALI.Increment_Last;
Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) := Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
...@@ -1685,6 +1691,12 @@ begin ...@@ -1685,6 +1691,12 @@ begin
Binder_Options_From_ALI.Increment_Last; Binder_Options_From_ALI.Increment_Last;
Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) := Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
new String'("-gnatiw"); new String'("-gnatiw");
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; end if;
-- Locate all the necessary programs and verify required files are present -- Locate all the necessary programs and verify required files are present
...@@ -1888,6 +1900,13 @@ begin ...@@ -1888,6 +1900,13 @@ begin
end Bind_Step; end Bind_Step;
end if; end if;
-- In CodePeer mode, there's nothing left to do after the binder file has
-- been compiled.
if Opt.CodePeer_Mode then
return;
end if;
-- Now, actually link the program -- Now, actually link the program
-- Skip this step for now on JVM since the Java interpreter will do -- Skip this step for now on JVM since the Java interpreter will do
......
...@@ -386,11 +386,9 @@ package body Make is ...@@ -386,11 +386,9 @@ package body Make is
-- with the switches -c, -b and -l. These flags are reset to True for -- with the switches -c, -b and -l. These flags are reset to True for
-- each invocation of procedure Gnatmake. -- each invocation of procedure Gnatmake.
Do_Codepeer_Globalize_Step : Boolean := False;
-- Flag to indicate whether the CodePeer globalizer should be called
Shared_String : aliased String := "-shared"; Shared_String : aliased String := "-shared";
Force_Elab_Flags_String : aliased String := "-F"; Force_Elab_Flags_String : aliased String := "-F";
CodePeer_Mode_String : aliased String := "-P";
No_Shared_Switch : aliased Argument_List := (1 .. 0 => null); No_Shared_Switch : aliased Argument_List := (1 .. 0 => null);
Shared_Switch : aliased Argument_List := (1 => Shared_String'Access); Shared_Switch : aliased Argument_List := (1 => Shared_String'Access);
...@@ -2927,7 +2925,7 @@ package body Make is ...@@ -2927,7 +2925,7 @@ package body Make is
then then
-- If we compile with -gnatC, enable CodePeer globalize step -- If we compile with -gnatC, enable CodePeer globalize step
Do_Codepeer_Globalize_Step := True; CodePeer_Mode := True;
end if; end if;
end loop; end loop;
...@@ -2968,7 +2966,7 @@ package body Make is ...@@ -2968,7 +2966,7 @@ package body Make is
declare declare
Str : String renames Args (Arg_Index).all; Str : String renames Args (Arg_Index).all;
begin begin
if Do_Codepeer_Globalize_Step if CodePeer_Mode
and then Str'Length > 2 and then Str'Length > 2
and then Str (Str'First .. Str'First + 1) = "-m" and then Str (Str'First .. Str'First + 1) = "-m"
then then
...@@ -4399,7 +4397,13 @@ package body Make is ...@@ -4399,7 +4397,13 @@ package body Make is
end; end;
end if; end if;
-- Add switch -M to gnatlink if buider switch --create-map-file if CodePeer_Mode then
Linker_Switches.Increment_Last;
Linker_Switches.Table (Linker_Switches.Last) :=
new String'(CodePeer_Mode_String);
end if;
-- Add switch -M to gnatlink if builder switch --create-map-file
-- has been specified. -- has been specified.
if Map_File /= null then if Map_File /= null then
...@@ -4560,6 +4564,11 @@ package body Make is ...@@ -4560,6 +4564,11 @@ package body Make is
Args (Last_Arg) := Force_Elab_Flags_String'Access; Args (Last_Arg) := Force_Elab_Flags_String'Access;
end if; end if;
if CodePeer_Mode then
Last_Arg := Last_Arg + 1;
Args (Last_Arg) := CodePeer_Mode_String'Access;
end if;
if Main_Project /= No_Project then if Main_Project /= No_Project then
-- Put all the source directories in ADA_INCLUDE_PATH, -- Put all the source directories in ADA_INCLUDE_PATH,
...@@ -6313,10 +6322,9 @@ package body Make is ...@@ -6313,10 +6322,9 @@ package body Make is
end if; end if;
end loop Multiple_Main_Loop; end loop Multiple_Main_Loop;
if Do_Codepeer_Globalize_Step then if CodePeer_Mode then
declare declare
Success : Boolean := False; Success : Boolean := False;
begin begin
Globalize (Success); Globalize (Success);
...@@ -7962,9 +7970,14 @@ package body Make is ...@@ -7962,9 +7970,14 @@ package body Make is
Add_Switch (Argv, Compiler, And_Save => And_Save); Add_Switch (Argv, Compiler, And_Save => And_Save);
Operating_Mode := Check_Semantics; Operating_Mode := Check_Semantics;
Check_Object_Consistency := False; Check_Object_Consistency := False;
Compile_Only := True;
Do_Bind_Step := False; if not CodePeer_Mode
Do_Link_Step := False; and then (Argv'Last < 7 or else Argv (7) /= 'C')
then
Compile_Only := True;
Do_Bind_Step := False;
Do_Link_Step := False;
end if;
elsif Argv (2 .. Argv'Last) = "nostdlib" then elsif Argv (2 .. Argv'Last) = "nostdlib" then
......
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