From f8dae9bb29d4dffc332c5a0670ff814816c87731 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 12 May 2015 10:36:45 +0200 Subject: [multiple changes] 2015-05-12 Robert Dewar * sem_ch3.adb: Minor reformatting. 2015-05-12 Vincent Celier * gnatcmd.adb: If we want to invoke gnatmake (gnatclean) with -P, then check if gprbuild (gprclean) is available; if it is, use gprbuild (gprclean) instead of gnatmake (gnatclean). 2015-05-12 Robert Dewar * debug.adb: Add flag -gnatd.3 to output diagnostic info from Exp_Unst. * einfo.ad, einfo.adb: Reorganize (and remove most of) flags used by Exp_Unst. * exp_ch6.adb (Unest_Bodies): Table for delayed calls to Unnest_Subprogram (Expand_N_Subprogram_Body): Add entry to table for later call instead of calling Unnest_Subprogram directly (Initialize): New procedure (Unnest_Subprograms): New procedure * exp_ch6.ads (Add_Extra_Actual_To_Call): Move into proper alpha order. (Initialize): New procedure. (Unnest_Subprograms): New procedure. * exp_unst.adb (Unnest_Subprogram): Major rewrite, moving all processing to this routine which is now called late after instantiating bodies. Fully handles the case of generic instantiations now. * exp_unst.ads: Major rewrite, moving all processing to Unnest_Subprogram. * frontend.adb (Frontend): Add call to Exp_Ch6.Initialize. (Frontend): Add call to Unnest_Subprograms. * sem_ch8.adb (Find_Direct_Name): Back to old calling sequence for Check_Nested_Access. * sem_util.adb (Build_Default_Subtype): Minor reformatting (Check_Nested_Access): Back to original VM-only form (we now do all the processing for Unnest_Subprogram at the time it is called. (Denotes_Same_Object): Minor reformatting (Note_Possible_Modification): Old calling sequence for Check_Nested_Access. * sem_util.ads (Check_Nested_Access): Back to original VM-only form (we now do all the processing for Unnest_Subprogram at the time it is called. From-SVN: r223043 --- gcc/ada/gnatcmd.adb | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'gcc/ada/gnatcmd.adb') diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb index 33c4be2..dcc3a85 100644 --- a/gcc/ada/gnatcmd.adb +++ b/gcc/ada/gnatcmd.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1996-2014, Free Software Foundation, Inc. -- +-- Copyright (C) 1996-2015, 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- -- @@ -57,6 +57,12 @@ with Ada.Text_IO; use Ada.Text_IO; with GNAT.OS_Lib; use GNAT.OS_Lib; procedure GNATCmd is + Gprbuild : constant String := "gprbuild"; + Gnatmake : constant String := "gnatmake"; + + Gprclean : constant String := "gprclean"; + Gnatclean : constant String := "gnatclean"; + Normal_Exit : exception; -- Raise this exception for normal program termination @@ -1166,7 +1172,6 @@ begin begin if The_Command = Stack then - -- Never call gnatstack with a prefix Program := new String'(Command_List (The_Command).Unixcmd.all); @@ -1174,6 +1179,40 @@ begin else Program := Program_Name (Command_List (The_Command).Unixcmd.all, "gnat"); + + -- If we want to invoke gnatmake/gnatclean with -P, then check if + -- gprbuild/gprclean is available; if it is, use gprbuild/gprclean + -- instead of gnatmake/gnatclean. + + if Program.all = Gnatmake or else Program.all = Gnatclean then + declare + Project_File_Used : Boolean := False; + Switch : String_Access; + + begin + for J in 1 .. Last_Switches.Last loop + Switch := Last_Switches.Table (J); + if Switch'Length >= 2 and then + Switch (Switch'First .. Switch'First + 1) = "-P" + then + Project_File_Used := True; + exit; + end if; + end loop; + + if Project_File_Used then + if Program.all = Gnatmake + and then Locate_Exec_On_Path (Gprbuild) /= null + then + Program := new String'(Gprbuild); + elsif Program.all = Gnatclean + and then Locate_Exec_On_Path (Gprclean) /= null + then + Program := new String'(Gprclean); + end if; + end if; + end; + end if; end if; -- For the tools where the GNAT driver processes the project files, -- cgit v1.1