summaryrefslogtreecommitdiff
path: root/gcc/ada/switch.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-13 10:23:29 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-13 10:23:29 +0000
commit453c24fb4dcaabaa2ef129d61468fc1e8733dcaa (patch)
tree740c5aba3c0949b0af4ce8a5af9213a4c4837b5f /gcc/ada/switch.ads
parent7b17e51b9ad5916b8df45cf5bedaf1ba81aaa0a2 (diff)
downloadgcc-453c24fb4dcaabaa2ef129d61468fc1e8733dcaa.tar.gz
2007-12-06 Bob Duff <duff@adacore.com>
* clean.adb (Usage): Add line for -aP (Check_Version_And_Help): Change Check_Version_And_Help to be generic, with a parameter "procedure Usage", instead of passing a pointer to a procedure. This is to eliminate trampolines (since the Usage procedure is often nested in a main procedure, and it would be inconvenient to unnest it). * g-comlin.adb (For_Each_Simple_Switch): Change For_Each_Simple_Switch to be generic, with a parameter "procedure Callback (...)", instead of passing a pointer to a procedure. This is to eliminate trampolines (since the Callback procedure is usually nested). * gnatfind.adb, switch.adb, switch.ads, gnatlink.adb, gnatls.adb, gnatname.adb, gnatxref.adb, gnatchop.adb, gprep.adb, gnatbind.adb (Check_Version_And_Help): Change Check_Version_And_Help to be generic. * g-pehage.adb (Compute_Edges_And_Vertices, Build_Identical_Key_Sets): Use the generic Heap_Sort_G instead of Heap_Sort_A. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130824 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/switch.ads')
-rw-r--r--gcc/ada/switch.ads48
1 files changed, 26 insertions, 22 deletions
diff --git a/gcc/ada/switch.ads b/gcc/ada/switch.ads
index 8a87b0f725a..e4ccc93f40a 100644
--- a/gcc/ada/switch.ads
+++ b/gcc/ada/switch.ads
@@ -23,16 +23,20 @@
-- --
------------------------------------------------------------------------------
--- This package together with a child package appropriate to the client
--- tool scans switches. Note that the body of the appropraite Usage package
--- must be coordinated with the switches that are recognized by this package.
--- These Usage packages also act as the official documentation for the
--- switches that are recognized. In addition, package Debug documents
--- the otherwise undocumented debug switches that are also recognized.
+-- This package together with a child package appropriate to the client tool
+-- scans switches. Note that the body of the appropraite Usage package must be
+-- coordinated with the switches that are recognized by this package. These
+-- Usage packages also act as the official documentation for the switches
+-- that are recognized. In addition, package Debug documents the otherwise
+-- undocumented debug switches that are also recognized.
with Gnatvsn;
with Types; use Types;
+------------
+-- Switch --
+------------
+
package Switch is
-- Common switches for GNU tools
@@ -44,15 +48,15 @@ package Switch is
-- Subprograms --
-----------------
- type Procedure_Ptr is access procedure;
-
- procedure Check_Version_And_Help
+ generic
+ with procedure Usage;
+ -- Print tool-specific part of --help message
+ procedure Check_Version_And_Help_G
(Tool_Name : String;
Initial_Year : String;
- Usage : Procedure_Ptr;
Version_String : String := Gnatvsn.Gnat_Version_String);
- -- Check if switches --version or --help is used. If one of this switch
- -- is used, issue the proper messages and end the process.
+ -- Check if switches --version or --help is used. If one of this switch is
+ -- used, issue the proper messages and end the process.
procedure Display_Version
(Tool_Name : String;
@@ -61,12 +65,12 @@ package Switch is
-- Display version of a tool when switch --version is used
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 ('-').
+ -- Returns True iff Switch_Chars is at least two characters long, and the
+ -- first character is an hyphen ('-').
function Is_Front_End_Switch (Switch_Chars : String) return Boolean;
- -- Returns True iff Switch_Chars represents a front-end switch,
- -- ie. it starts with -I, -gnat or -?RTS.
+ -- Returns True iff Switch_Chars represents a front-end switch, i.e. it
+ -- starts with -I, -gnat or -?RTS.
private
@@ -83,9 +87,9 @@ private
Ptr : in out Integer;
Result : out Nat;
Switch : Character);
- -- Scan natural integer parameter for switch. On entry, Ptr points
- -- just past the switch character, on exit it points past the last
- -- digit of the integer value.
+ -- Scan natural integer parameter for switch. On entry, Ptr points just
+ -- past the switch character, on exit it points past the last digit of the
+ -- integer value.
procedure Scan_Pos
(Switch_Chars : String;
@@ -93,9 +97,9 @@ private
Ptr : in out Integer;
Result : out Pos;
Switch : Character);
- -- Scan positive integer parameter for switch. On entry, Ptr points
- -- just past the switch character, on exit it points past the last
- -- digit of the integer value.
+ -- Scan positive integer parameter for switch. On entry, Ptr points just
+ -- past the switch character, on exit it points past the last digit of the
+ -- integer value.
procedure Bad_Switch (Switch : Character);
procedure Bad_Switch (Switch : String);