Commit 439b6dfa by Arnaud Charlet

[multiple changes]

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
parent f2404867
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
......
......@@ -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");
......
......@@ -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");
......
......@@ -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");
......
......@@ -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");
......
......@@ -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");
......
......@@ -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");
......
......@@ -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;
......
......@@ -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");
......
......@@ -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");
......
......@@ -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;
......
......@@ -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");
......
......@@ -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 --
---------------------
......
......@@ -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 ('-').
......
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