From 7beef224a4d678673a0fc98d8ec9dfdd0ea41787 Mon Sep 17 00:00:00 2001 From: charlet Date: Fri, 2 Sep 2011 09:36:28 +0000 Subject: [PATCH] 2011-09-02 Robert Dewar * lib-xref.adb: Minor reformatting 2011-09-02 Vincent Celier * bindusg.adb, clean.adb, gnatchop.adb, gnatfind.adb, gnatlink.adb, gnatls.adb, gnatname.adb, gnatxref.adb, gprep.adb, makeusg.adb: Add --version and --help in usage. * switch.ads, switch.adb (Display_Usage_Version_And_Help): New procedure git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178454 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 11 +++++++++++ gcc/ada/bindusg.adb | 3 +++ gcc/ada/clean.adb | 2 ++ gcc/ada/gnatchop.adb | 5 ++++- gcc/ada/gnatfind.adb | 3 ++- gcc/ada/gnatlink.adb | 2 ++ gcc/ada/gnatls.adb | 2 ++ gcc/ada/gnatname.adb | 4 +++- gcc/ada/gnatxref.adb | 3 ++- gcc/ada/gprep.adb | 3 ++- gcc/ada/lib-xref.adb | 13 +++++++++---- gcc/ada/makeusg.adb | 3 +++ gcc/ada/switch.adb | 14 ++++++++++++++ gcc/ada/switch.ads | 3 +++ 14 files changed, 62 insertions(+), 9 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1af7b0d..9321841 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2011-09-02 Robert Dewar + + * lib-xref.adb: Minor reformatting + +2011-09-02 Vincent Celier + + * bindusg.adb, clean.adb, gnatchop.adb, gnatfind.adb, gnatlink.adb, + gnatls.adb, gnatname.adb, gnatxref.adb, gprep.adb, makeusg.adb: Add + --version and --help in usage. + * switch.ads, switch.adb (Display_Usage_Version_And_Help): New procedure + 2011-09-02 Bob Duff * lib-xref.adb: (Hash): Avoid use of 'Mod attribute, because old diff --git a/gcc/ada/bindusg.adb b/gcc/ada/bindusg.adb index e762c87..23840d3 100644 --- a/gcc/ada/bindusg.adb +++ b/gcc/ada/bindusg.adb @@ -25,6 +25,7 @@ with Osint; use Osint; with Output; use Output; +with Switch; use Switch; with System.WCh_Con; use System.WCh_Con; @@ -55,6 +56,8 @@ package body Bindusg is Write_Eol; Write_Eol; + Display_Usage_Version_And_Help; + -- Line for @response_file Write_Line (" @ Get arguments from response file"); diff --git a/gcc/ada/clean.adb b/gcc/ada/clean.adb index d6dc8ba..f202533 100644 --- a/gcc/ada/clean.adb +++ b/gcc/ada/clean.adb @@ -1893,6 +1893,8 @@ package body Clean is Put_Line ("Usage: gnatclean [switches] {[-innn] name}"); New_Line; + Display_Usage_Version_And_Help; + Put_Line (" names is one or more file names from which " & "the .adb or .ads suffix may be omitted"); Put_Line (" names may be omitted if -P is specified"); diff --git a/gcc/ada/gnatchop.adb b/gcc/ada/gnatchop.adb index c72ac75..4cec050 100644 --- a/gcc/ada/gnatchop.adb +++ b/gcc/ada/gnatchop.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-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- -- @@ -1361,6 +1361,9 @@ procedure Gnatchop is "[-r] [-p] [-q] [-v] [-w] [-x] [--GCC=xx] file [file ...] [dir]"); New_Line; + + Display_Usage_Version_And_Help; + Put_Line (" -c compilation mode, configuration pragmas " & "follow RM rules"); diff --git a/gcc/ada/gnatfind.adb b/gcc/ada/gnatfind.adb index 8af7b9e..a98e013 100644 --- a/gcc/ada/gnatfind.adb +++ b/gcc/ada/gnatfind.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-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- -- @@ -299,6 +299,7 @@ procedure Gnatfind is & "references. This parameters are optional"); New_Line; Put_Line ("gnatfind switches:"); + Display_Usage_Version_And_Help; Put_Line (" -a Consider all files, even when the ali file is " & "readonly"); Put_Line (" -aIdir Specify source files search path"); diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb index 5afe2be..61d3db3 100644 --- a/gcc/ada/gnatlink.adb +++ b/gcc/ada/gnatlink.adb @@ -1422,6 +1422,8 @@ procedure Gnatlink is Write_Eol; Write_Line (" mainprog.ali the ALI file of the main program"); Write_Eol; + Write_Eol; + Display_Usage_Version_And_Help; Write_Line (" -f Force object file list to be generated"); Write_Line (" -g Compile binder source file with debug information"); Write_Line (" -n Do not compile the binder source file"); diff --git a/gcc/ada/gnatls.adb b/gcc/ada/gnatls.adb index 5f9f236..7c7b41f 100644 --- a/gcc/ada/gnatls.adb +++ b/gcc/ada/gnatls.adb @@ -1386,6 +1386,8 @@ procedure Gnatls is Write_Str ("switches:"); Write_Eol; + Display_Usage_Version_And_Help; + -- Line for -a Write_Str (" -a also output relevant predefined units"); diff --git a/gcc/ada/gnatname.adb b/gcc/ada/gnatname.adb index 00ebebe..c741834 100644 --- a/gcc/ada/gnatname.adb +++ b/gcc/ada/gnatname.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2010, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-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- -- @@ -512,6 +512,8 @@ procedure Gnatname is Write_Eol; Write_Line ("switches:"); + Display_Usage_Version_And_Help; + Write_Line (" --subdirs=dir real obj/lib/exec dirs are subdirs"); Write_Eol; diff --git a/gcc/ada/gnatxref.adb b/gcc/ada/gnatxref.adb index c20ef17..cbdf54a 100644 --- a/gcc/ada/gnatxref.adb +++ b/gcc/ada/gnatxref.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2010, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-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- -- @@ -257,6 +257,7 @@ procedure Gnatxref is "including with'ed units"); New_Line; Put_Line ("gnatxref switches:"); + Display_Usage_Version_And_Help; Put_Line (" -a Consider all files, even when the ali file is" & " readonly"); Put_Line (" -aIdir Specify source files search path"); diff --git a/gcc/ada/gprep.adb b/gcc/ada/gprep.adb index 88710d6..f6ce3ac 100644 --- a/gcc/ada/gprep.adb +++ b/gcc/ada/gprep.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2002-2010, Free Software Foundation, Inc. -- +-- Copyright (C) 2002-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- -- @@ -808,6 +808,7 @@ package body GPrep is Write_Line (" deffile Name of the definition file"); Write_Eol; Write_Line ("gnatprep switches:"); + Display_Usage_Version_And_Help; Write_Line (" -b Replace preprocessor lines by blank lines"); Write_Line (" -c Keep preprocessor lines as comments"); Write_Line (" -C Do symbol replacements within comments"); diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb index e8c47d7..f2df15f 100644 --- a/gcc/ada/lib-xref.adb +++ b/gcc/ada/lib-xref.adb @@ -1058,10 +1058,15 @@ package body Lib.Xref is XE : Xref_Entry renames Xrefs.Table (F); type M is mod 2**32; - H : constant M := M (XE.Key.Ent) + 2**7 * M (abs XE.Key.Loc); - -- We can't use M'Mod above, because it prevents bootstrapping with - -- older compilers. Loc can be negative, so we do "abs" before - -- converting. + H : constant M := M (XE.Key.Ent) + 2 ** 7 * M (abs XE.Key.Loc); + -- It would be more natural to write: + -- + -- H : constant M := M'Mod (XE.Key.Ent) + 2**7 * M'Mod (XE.Key.Loc); + -- + -- But we can't use M'Mod, because it prevents bootstrapping with older + -- compilers. Loc can be negative, so we do "abs" before converting. + -- One day this can be cleaned up ??? + begin return Header_Num (H mod Num_Buckets); end Hash; diff --git a/gcc/ada/makeusg.adb b/gcc/ada/makeusg.adb index f2889a2..62cc703 100644 --- a/gcc/ada/makeusg.adb +++ b/gcc/ada/makeusg.adb @@ -26,6 +26,7 @@ with Makeutl; with Osint; use Osint; with Output; use Output; +with Switch; use Switch; with Usage; procedure Makeusg is @@ -51,6 +52,8 @@ begin Write_Str ("gnatmake switches:"); Write_Eol; + Display_Usage_Version_And_Help; + -- Line for -a Write_Str (" -a Consider all files, even readonly ali files"); diff --git a/gcc/ada/switch.adb b/gcc/ada/switch.adb index 000f951..f871b19 100644 --- a/gcc/ada/switch.adb +++ b/gcc/ada/switch.adb @@ -98,6 +98,20 @@ package body Switch is end if; end Check_Version_And_Help_G; + ------------------------------------ + -- Display_Usage_Version_And_Help -- + ------------------------------------ + + procedure Display_Usage_Version_And_Help is + begin + Write_Str (" --version Display version and exit"); + Write_Eol; + + Write_Str (" --help Display usage and exit"); + Write_Eol; + Write_Eol; + end Display_Usage_Version_And_Help; + --------------------- -- Display_Version -- --------------------- diff --git a/gcc/ada/switch.ads b/gcc/ada/switch.ads index ce3b371..b55e2fc 100644 --- a/gcc/ada/switch.ads +++ b/gcc/ada/switch.ads @@ -64,6 +64,9 @@ package Switch is Version_String : String := Gnatvsn.Gnat_Version_String); -- Display version of a tool when switch --version is used + procedure Display_Usage_Version_And_Help; + -- Output the two lines of usage for switches --version and --help + function Is_Switch (Switch_Chars : String) return Boolean; -- Returns True iff Switch_Chars is at least two characters long, and the -- first character is an hyphen ('-'). -- 2.7.4