Commit 0c61772a by Arnaud Charlet

[multiple changes]

2016-04-20  Vincent Celier  <celier@adacore.com>

	* gnatcmd.adb: Do not invoke gprls when the invocation of "gnat
	ls" includes the switch -V.
	* clean.adb: "<target>-gnatclean -P" now calls "gprclean
	--target=<target>"
	* make.adb: "<target>-gnatmake -P" now calls "gprbuild
	--target=<target>"

2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch12.adb (Qualify_Type): Do not perform
	partial qualification when the immediate scope is a generic unit.

From-SVN: r235260
parent 61d1b085
2016-04-20 Vincent Celier <celier@adacore.com>
* gnatcmd.adb: Do not invoke gprls when the invocation of "gnat
ls" includes the switch -V.
* clean.adb: "<target>-gnatclean -P" now calls "gprclean
--target=<target>"
* make.adb: "<target>-gnatmake -P" now calls "gprbuild
--target=<target>"
2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch12.adb (Qualify_Type): Do not perform
partial qualification when the immediate scope is a generic unit.
2016-04-20 Hristian Kirtchev <kirtchev@adacore.com> 2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
* exp_unst.adb: Minor reformatting. * exp_unst.adb: Minor reformatting.
......
...@@ -1619,8 +1619,8 @@ package body Clean is ...@@ -1619,8 +1619,8 @@ package body Clean is
procedure Parse_Cmd_Line is procedure Parse_Cmd_Line is
Last : constant Natural := Argument_Count; Last : constant Natural := Argument_Count;
Source_Index : Int := 0;
Index : Positive; Index : Positive;
Source_Index : Int := 0;
procedure Check_Version_And_Help is new Check_Version_And_Help_G (Usage); procedure Check_Version_And_Help is new Check_Version_And_Help_G (Usage);
...@@ -1629,16 +1629,29 @@ package body Clean is ...@@ -1629,16 +1629,29 @@ package body Clean is
Check_Version_And_Help ("GNATCLEAN", "2003"); Check_Version_And_Help ("GNATCLEAN", "2003");
-- First, for native gnatclean, check for switch -P and, if found and -- First, check for switch -P and, if found and gprclean is available,
-- gprclean is available, silently invoke gprclean. -- silently invoke gprclean, with switch --target if not on a native
-- platform.
Find_Program_Name; declare
Arg_Len : Positive := Argument_Count;
Call_Gprclean : Boolean := False;
Gprclean : String_Access := null;
Pos : Natural := 0;
Success : Boolean;
Target : String_Access := null;
if Name_Buffer (1 .. Name_Len) = "gnatclean" then begin
declare Find_Program_Name;
Call_Gprclean : Boolean := False;
if Name_Len >= 9
and then Name_Buffer (Name_Len - 8 .. Name_Len) = "gnatclean"
then
if Name_Len > 9 then
Target := new String'(Name_Buffer (1 .. Name_Len - 10));
Arg_Len := Arg_Len + 1;
end if;
begin
for J in 1 .. Argument_Count loop for J in 1 .. Argument_Count loop
declare declare
Arg : constant String := Argument (J); Arg : constant String := Argument (J);
...@@ -1653,16 +1666,20 @@ package body Clean is ...@@ -1653,16 +1666,20 @@ package body Clean is
end loop; end loop;
if Call_Gprclean then if Call_Gprclean then
declare Gprclean := Locate_Exec_On_Path (Exec_Name => "gprclean");
Gprclean : String_Access :=
Locate_Exec_On_Path (Exec_Name => "gprclean"); if Gprclean /= null then
Args : Argument_List (1 .. Argument_Count); declare
Success : Boolean; Args : Argument_List (1 .. Arg_Len);
begin
if Target /= null then
Args (1) := new String'("--target=" & Target.all);
Pos := 1;
end if;
begin
if Gprclean /= null then
for J in 1 .. Argument_Count loop for J in 1 .. Argument_Count loop
Args (J) := new String'(Argument (J)); Pos := Pos + 1;
Args (Pos) := new String'(Argument (J));
end loop; end loop;
Spawn (Gprclean.all, Args, Success); Spawn (Gprclean.all, Args, Success);
...@@ -1672,11 +1689,11 @@ package body Clean is ...@@ -1672,11 +1689,11 @@ package body Clean is
if Success then if Success then
Exit_Program (E_Success); Exit_Program (E_Success);
end if; end if;
end if; end;
end; end if;
end if; end if;
end; end if;
end if; end;
Index := 1; Index := 1;
while Index <= Last loop while Index <= Last loop
......
...@@ -6413,16 +6413,29 @@ package body Make is ...@@ -6413,16 +6413,29 @@ package body Make is
-- Scan again the switch and arguments, now that we are sure that they -- Scan again the switch and arguments, now that we are sure that they
-- do not include --version or --help. -- do not include --version or --help.
-- First, for native gnatmake, check for switch -P and, if found and -- First, check for switch -P and, if found and gprbuild is available,
-- gprbuild is available, silently invoke gprbuild. -- silently invoke gprbuild, with switch --target if not on a native
-- platform.
Find_Program_Name; declare
Arg_Len : Positive := Argument_Count;
Call_Gprbuild : Boolean := False;
Gprbuild : String_Access := null;
Pos : Natural := 0;
Success : Boolean;
Target : String_Access := null;
if Name_Buffer (1 .. Name_Len) = "gnatmake" then begin
declare Find_Program_Name;
Call_Gprbuild : Boolean := False;
if Name_Len >= 8
and then Name_Buffer (Name_Len - 7 .. Name_Len) = "gnatmake"
then
if Name_Len > 8 then
Target := new String'(Name_Buffer (1 .. Name_Len - 9));
Arg_Len := Arg_Len + 1;
end if;
begin
for J in 1 .. Argument_Count loop for J in 1 .. Argument_Count loop
declare declare
Arg : constant String := Argument (J); Arg : constant String := Argument (J);
...@@ -6437,16 +6450,20 @@ package body Make is ...@@ -6437,16 +6450,20 @@ package body Make is
end loop; end loop;
if Call_Gprbuild then if Call_Gprbuild then
declare Gprbuild := Locate_Exec_On_Path (Exec_Name => "gprbuild");
Gprbuild : String_Access :=
Locate_Exec_On_Path (Exec_Name => "gprbuild"); if Gprbuild /= null then
Args : Argument_List (1 .. Argument_Count); declare
Success : Boolean; Args : Argument_List (1 .. Arg_Len);
begin
if Target /= null then
Args (1) := new String'("--target=" & Target.all);
Pos := 1;
end if;
begin
if Gprbuild /= null then
for J in 1 .. Argument_Count loop for J in 1 .. Argument_Count loop
Args (J) := new String'(Argument (J)); Pos := Pos + 1;
Args (Pos) := new String'(Argument (J));
end loop; end loop;
Spawn (Gprbuild.all, Args, Success); Spawn (Gprbuild.all, Args, Success);
...@@ -6456,11 +6473,11 @@ package body Make is ...@@ -6456,11 +6473,11 @@ package body Make is
if Success then if Success then
Exit_Program (E_Success); Exit_Program (E_Success);
end if; end if;
end if; end;
end; end if;
end if; end if;
end; end if;
end if; end;
Scan_Args : for Next_Arg in 1 .. Argument_Count loop Scan_Args : for Next_Arg in 1 .. Argument_Count loop
Scan_Make_Arg (Env, Argument (Next_Arg), And_Save => True); Scan_Make_Arg (Env, Argument (Next_Arg), And_Save => True);
......
...@@ -14052,7 +14052,7 @@ package body Sem_Ch12 is ...@@ -14052,7 +14052,7 @@ package body Sem_Ch12 is
begin begin
Result := Make_Identifier (Loc, Chars (Typ)); Result := Make_Identifier (Loc, Chars (Typ));
if Present (Scop) and then Scop /= Standard_Standard then if Present (Scop) and then not Is_Generic_Unit (Scop) then
Result := Result :=
Make_Selected_Component (Loc, Make_Selected_Component (Loc,
Prefix => Make_Identifier (Loc, Chars (Scop)), Prefix => Make_Identifier (Loc, Chars (Scop)),
......
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