[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 2 Sep 2011 09:36:28 +0000 (11:36 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 2 Sep 2011 09:36:28 +0000 (11:36 +0200)
2011-09-02  Robert Dewar  <dewar@adacore.com>

* lib-xref.adb: Minor reformatting

2011-09-02  Vincent Celier  <celier@adacore.com>

* 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

From-SVN: r178454

14 files changed:
gcc/ada/ChangeLog
gcc/ada/bindusg.adb
gcc/ada/clean.adb
gcc/ada/gnatchop.adb
gcc/ada/gnatfind.adb
gcc/ada/gnatlink.adb
gcc/ada/gnatls.adb
gcc/ada/gnatname.adb
gcc/ada/gnatxref.adb
gcc/ada/gprep.adb
gcc/ada/lib-xref.adb
gcc/ada/makeusg.adb
gcc/ada/switch.adb
gcc/ada/switch.ads

index 1af7b0dda3db8a93c30f453ef52b30eb056294dd..9321841aacd016120295eff680ec235055d33b02 100644 (file)
@@ -1,3 +1,14 @@
+2011-09-02  Robert Dewar  <dewar@adacore.com>
+
+       * lib-xref.adb: Minor reformatting
+
+2011-09-02  Vincent Celier  <celier@adacore.com>
+
+       * 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  <duff@adacore.com>
 
        * lib-xref.adb: (Hash): Avoid use of 'Mod attribute, because old
index e762c872fcbb8160eb05142a8d6eff16899390b5..23840d3048c2c5c1cc451d5cb8b172179d91579c 100644 (file)
@@ -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 ("  @<resp_file> Get arguments from response file");
index d6dc8ba140ed2128f68d461e10d26d62b5609f40..f20253391cdf476e0b4774a385299c78fb96b7d8 100644 (file)
@@ -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<project> is specified");
index c72ac75b1f00a5bec92e99ad349fe9a727b63dda..4cec050321c5c6274b28d4cc8afcf7d896fbb10b 100644 (file)
@@ -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");
index 8af7b9e4f8b57e1bc6a55e87b097eb8a68e95997..a98e013f2f86a0606b1be53396d00d4d750ab53f 100644 (file)
@@ -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");
index 5afe2be6306b763b835f58c02cc87f0eee344633..61d3db3861fb0b5f52f3f2313f2ffe6424b1fd5a 100644 (file)
@@ -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");
index 5f9f2368993d99b397d67fba53a43c15369d134a..7c7b41f89e88966deaa697146583971e611410ab 100644 (file)
@@ -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");
index 00ebebe413ec6c67eedfdf592079641a33a5ca07..c741834ec29a58bf1731769a27c99daecd9f9372 100644 (file)
@@ -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;
 
index c20ef1755647db4ebb022b54932e520d5a0a2933..cbdf54a6d942b9e60c21b382c005e80936efcc8b 100644 (file)
@@ -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");
index 88710d6206cfa967fd12e858fe11f620eeb9763a..f6ce3acf02ee48275d3f038cc6818d8f886bb41f 100644 (file)
@@ -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");
index e8c47d7025f944f09cb80d3483fdc7d59effa112..f2df15f42761762d5535d12de2cb668aa2abef58 100644 (file)
@@ -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;
index f2889a26c0139d7af22825eb5fe76447524d8687..62cc703094b467b9c6f2db506cb324bf044328c6 100644 (file)
@@ -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");
index 000f95136c52548918de3bf13e2c029a7a2c2352..f871b19fa1a001e0c9afebb9adb701efc6786ba0 100644 (file)
@@ -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 --
    ---------------------
index ce3b37166eb2bd7b1d1ffb15efa04e99b730ad8f..b55e2fcf0de35882407ee59ec0210bb93d348d82 100644 (file)
@@ -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 ('-').