aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gnatbind.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-04-24 15:08:31 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2013-04-24 15:08:31 +0200
commitb546e2a732f0572fb3119facb48ead0b44c75afc (patch)
treea3be080dfdcb9afdc5009eb2a2f98b02acae6330 /gcc/ada/gnatbind.adb
parentdba44dbef91efd698ead6dcce7b19a24a4522000 (diff)
downloadgcc-b546e2a732f0572fb3119facb48ead0b44c75afc.zip
gcc-b546e2a732f0572fb3119facb48ead0b44c75afc.tar.gz
gcc-b546e2a732f0572fb3119facb48ead0b44c75afc.tar.bz2
[multiple changes]
2013-04-24 Eric Botcazou <ebotcazou@adacore.com> * fe.h (Machine_Overflows_On_Target): New macro and declaration. (Signed_Zeros_On_Target): Likewise. 2013-04-24 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch6.adb: Add with and use clause for Sem_Prag. (Freeze_Subprogram): Analyze all delayed aspects for a null procedure so that they are available when analyzing the internally-generated _Postconditions routine. * exp_ch13.adb: Remove with and use clause for Sem_Prag. (Expand_N_Freeze_Entity): Move the code that analyzes delayed aspects of null procedures to exp_ch6.Freeze_Subprogram. * sem_prag.adb (Analyze_Abstract_State): Update the check on volatile requirements. 2013-04-24 Bob Duff <duff@adacore.com> * ali-util.ads (Source_Record): New component Stamp_File to record from whence the Stamp came. * ali-util.adb (Set_Source_Table): Set Stamp_File component. * bcheck.adb (Check_Consistency): Print additional information in Verbose_Mode. * gnatbind.adb (Gnatbind): Print additional information in Verbose_Mode. From-SVN: r198224
Diffstat (limited to 'gcc/ada/gnatbind.adb')
-rw-r--r--gcc/ada/gnatbind.adb102
1 files changed, 69 insertions, 33 deletions
diff --git a/gcc/ada/gnatbind.adb b/gcc/ada/gnatbind.adb
index 63e7c14..30f6141 100644
--- a/gcc/ada/gnatbind.adb
+++ b/gcc/ada/gnatbind.adb
@@ -73,7 +73,6 @@ procedure Gnatbind is
-- Standard library
Text : Text_Buffer_Ptr;
- Next_Arg : Positive;
Output_File_Name_Seen : Boolean := False;
Output_File_Name : String_Ptr := new String'("");
@@ -104,6 +103,15 @@ procedure Gnatbind is
-- All the one character arguments are still handled by Switch. This
-- routine handles -aO -aI and -I-. The lower bound of Argv must be 1.
+ generic
+ with procedure Action (Argv : String);
+ procedure Generic_Scan_Bind_Args;
+ -- Iterate through the args calling Action on each one, taking care of
+ -- response files.
+
+ procedure Write_Arg (S : String);
+ -- Passed to Generic_Scan_Bind_Args to print args
+
function Is_Cross_Compiler return Boolean;
-- Returns True iff this is a cross-compiler
@@ -480,12 +488,64 @@ procedure Gnatbind is
end if;
end Scan_Bind_Arg;
+ ----------------------------
+ -- Generic_Scan_Bind_Args --
+ ----------------------------
+
+ procedure Generic_Scan_Bind_Args is
+ Next_Arg : Positive := 1;
+ begin
+ -- Use low level argument routines to avoid dragging in the secondary
+ -- stack
+
+ while Next_Arg < Arg_Count loop
+ declare
+ Next_Argv : String (1 .. Len_Arg (Next_Arg));
+ begin
+ Fill_Arg (Next_Argv'Address, Next_Arg);
+
+ if Next_Argv'Length > 0 then
+ if Next_Argv (1) = '@' then
+ if Next_Argv'Length > 1 then
+ declare
+ Arguments : constant Argument_List :=
+ Response_File.Arguments_From
+ (Response_File_Name =>
+ Next_Argv (2 .. Next_Argv'Last),
+ Recursive => True,
+ Ignore_Non_Existing_Files => True);
+ begin
+ for J in Arguments'Range loop
+ Action (Arguments (J).all);
+ end loop;
+ end;
+ end if;
+
+ else
+ Action (Next_Argv);
+ end if;
+ end if;
+ end;
+
+ Next_Arg := Next_Arg + 1;
+ end loop;
+ end Generic_Scan_Bind_Args;
+
+ procedure Write_Arg (S : String) is
+ begin
+ Write_Str (" " & S);
+ end Write_Arg;
+
+ procedure Scan_Bind_Args is new Generic_Scan_Bind_Args (Scan_Bind_Arg);
+ procedure Put_Bind_Args is new Generic_Scan_Bind_Args (Write_Arg);
+
procedure Check_Version_And_Help is
new Check_Version_And_Help_G (Bindusg.Display);
-- Start of processing for Gnatbind
begin
+
-- Set default for Shared_Libgnat option
declare
@@ -510,40 +570,16 @@ begin
Check_Version_And_Help ("GNATBIND", "1995");
- -- Use low level argument routines to avoid dragging in the secondary stack
+ -- We need to Scan_Bind_Args first, to set Verbose_Mode, so we know whether
+ -- to Put_Bind_Args.
- Next_Arg := 1;
- Scan_Args : while Next_Arg < Arg_Count loop
- declare
- Next_Argv : String (1 .. Len_Arg (Next_Arg));
- begin
- Fill_Arg (Next_Argv'Address, Next_Arg);
-
- if Next_Argv'Length > 0 then
- if Next_Argv (1) = '@' then
- if Next_Argv'Length > 1 then
- declare
- Arguments : constant Argument_List :=
- Response_File.Arguments_From
- (Response_File_Name =>
- Next_Argv (2 .. Next_Argv'Last),
- Recursive => True,
- Ignore_Non_Existing_Files => True);
- begin
- for J in Arguments'Range loop
- Scan_Bind_Arg (Arguments (J).all);
- end loop;
- end;
- end if;
+ Scan_Bind_Args;
- else
- Scan_Bind_Arg (Next_Argv);
- end if;
- end if;
- end;
-
- Next_Arg := Next_Arg + 1;
- end loop Scan_Args;
+ if Verbose_Mode then
+ Write_Str (Command_Name);
+ Put_Bind_Args;
+ Write_Eol;
+ end if;
if Use_Pragma_Linker_Constructor then
if Bind_Main_Program then