Commit 9f5b865a by Vincent Celier Committed by Arnaud Charlet

switch-c.adb: Document internal switches.

2013-04-11  Vincent Celier  <celier@adacore.com>

	* switch-c.adb: Document internal switches.
	* usage.adb: Remove lines for internal switches: -gnatea, -gnateO,
	-gnatez and -gnateO.

From-SVN: r197782
parent afb4a8cd
2013-04-11 Vincent Celier <celier@adacore.com>
* switch-c.adb: Document internal switches.
* usage.adb: Remove lines for internal switches: -gnatea, -gnateO,
-gnatez and -gnateO.
2013-04-11 Ed Schonberg <schonberg@adacore.com> 2013-04-11 Ed Schonberg <schonberg@adacore.com>
* par-ch6.adb (P_Subprogram): Attach aspects to subprogram stub. * par-ch6.adb (P_Subprogram): Attach aspects to subprogram stub.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2001-2012, Free Software Foundation, Inc. -- -- Copyright (C) 2001-2013, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -274,30 +274,32 @@ package body Switch.C is ...@@ -274,30 +274,32 @@ package body Switch.C is
case C is case C is
-- -gnata (assertions enabled)
when 'a' => when 'a' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Assertions_Enabled := True; Assertions_Enabled := True;
Debug_Pragmas_Enabled := True; Debug_Pragmas_Enabled := True;
-- Processing for A switch -- -gnatA (disregard gnat.adc)
when 'A' => when 'A' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Config_File := False; Config_File := False;
-- Processing for b switch -- -gnatb (brief messages to stderr)
when 'b' => when 'b' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Brief_Output := True; Brief_Output := True;
-- Processing for B switch -- -gnatB (assume no invalid values)
when 'B' => when 'B' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Assume_No_Invalid_Values := True; Assume_No_Invalid_Values := True;
-- Processing for c switch -- -gnatc (check syntax and semantics only)
when 'c' => when 'c' =>
if not First_Switch then if not First_Switch then
...@@ -308,7 +310,7 @@ package body Switch.C is ...@@ -308,7 +310,7 @@ package body Switch.C is
Ptr := Ptr + 1; Ptr := Ptr + 1;
Operating_Mode := Check_Semantics; Operating_Mode := Check_Semantics;
-- Processing for C switch -- -gnatC (Generate CodePeer information)
when 'C' => when 'C' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
...@@ -326,7 +328,7 @@ package body Switch.C is ...@@ -326,7 +328,7 @@ package body Switch.C is
Warning_Mode := Suppress; Warning_Mode := Suppress;
end if; end if;
-- Processing for d switch -- -gnatd (compiler debug options)
when 'd' => when 'd' =>
Store_Switch := False; Store_Switch := False;
...@@ -367,7 +369,7 @@ package body Switch.C is ...@@ -367,7 +369,7 @@ package body Switch.C is
return; return;
-- Processing for D switch -- -gnatD (debug expanded code)
when 'D' => when 'D' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
...@@ -403,6 +405,8 @@ package body Switch.C is ...@@ -403,6 +405,8 @@ package body Switch.C is
-- -gnatea (initial delimiter of explicit switches) -- -gnatea (initial delimiter of explicit switches)
-- This is an internal switch
-- All switches that come before -gnatea have been added by -- All switches that come before -gnatea have been added by
-- the GCC driver and are not stored in the ALI file. -- the GCC driver and are not stored in the ALI file.
-- See also -gnatez below. -- See also -gnatez below.
...@@ -562,6 +566,8 @@ package body Switch.C is ...@@ -562,6 +566,8 @@ package body Switch.C is
-- -gnateO= (object path file) -- -gnateO= (object path file)
-- This is an internal switch
when 'O' => when 'O' =>
Store_Switch := False; Store_Switch := False;
Ptr := Ptr + 1; Ptr := Ptr + 1;
...@@ -641,6 +647,8 @@ package body Switch.C is ...@@ -641,6 +647,8 @@ package body Switch.C is
-- -gnatez (final delimiter of explicit switches) -- -gnatez (final delimiter of explicit switches)
-- This is an internal switch
-- All switches that come after -gnatez have been added by -- All switches that come after -gnatez have been added by
-- the GCC driver and are not stored in the ALI file. See -- the GCC driver and are not stored in the ALI file. See
-- also -gnatea above. -- also -gnatea above.
...@@ -668,14 +676,14 @@ package body Switch.C is ...@@ -668,14 +676,14 @@ package body Switch.C is
Ptr := Ptr + 1; Ptr := Ptr + 1;
All_Errors_Mode := True; All_Errors_Mode := True;
-- Processing for F switch -- -gnatF (overflow of predefined float types)
when 'F' => when 'F' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
External_Name_Exp_Casing := Uppercase; External_Name_Exp_Casing := Uppercase;
External_Name_Imp_Casing := Uppercase; External_Name_Imp_Casing := Uppercase;
-- Processing for g switch -- -gnatg (GNAT implementation mode)
when 'g' => when 'g' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
...@@ -696,7 +704,7 @@ package body Switch.C is ...@@ -696,7 +704,7 @@ package body Switch.C is
Set_GNAT_Mode_Warnings; Set_GNAT_Mode_Warnings;
Set_GNAT_Style_Check_Options; Set_GNAT_Style_Check_Options;
-- Processing for G switch -- -gnatG (output generated code)
when 'G' => when 'G' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
...@@ -709,13 +717,13 @@ package body Switch.C is ...@@ -709,13 +717,13 @@ package body Switch.C is
Sprint_Line_Limit := Nat'Max (Sprint_Line_Limit, 40); Sprint_Line_Limit := Nat'Max (Sprint_Line_Limit, 40);
end if; end if;
-- Processing for h switch -- -gnath (help information)
when 'h' => when 'h' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Usage_Requested := True; Usage_Requested := True;
-- Processing for i switch -- -gnati (character set)
when 'i' => when 'i' =>
if Ptr = Max then if Ptr = Max then
...@@ -740,26 +748,26 @@ package body Switch.C is ...@@ -740,26 +748,26 @@ package body Switch.C is
Bad_Switch ("-gnati" & Switch_Chars (Ptr .. Max)); Bad_Switch ("-gnati" & Switch_Chars (Ptr .. Max));
end if; end if;
-- Processing for I switch -- -gnatI (ignore representation clauses)
when 'I' => when 'I' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Ignore_Rep_Clauses := True; Ignore_Rep_Clauses := True;
-- Processing for j switch -- -gnatj (messages in limited length lines)
when 'j' => when 'j' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Scan_Nat (Switch_Chars, Max, Ptr, Error_Msg_Line_Length, C); Scan_Nat (Switch_Chars, Max, Ptr, Error_Msg_Line_Length, C);
-- Processing for k switch -- -gnatk (limit file name length)
when 'k' => when 'k' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Scan_Pos Scan_Pos
(Switch_Chars, Max, Ptr, Maximum_File_Name_Length, C); (Switch_Chars, Max, Ptr, Maximum_File_Name_Length, C);
-- Processing for l switch -- -gnatl (output full source)
when 'l' => when 'l' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
...@@ -777,19 +785,19 @@ package body Switch.C is ...@@ -777,19 +785,19 @@ package body Switch.C is
end if; end if;
end if; end if;
-- Processing for L switch -- -gnatL (corresponding source text)
when 'L' => when 'L' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Dump_Source_Text := True; Dump_Source_Text := True;
-- Processing for m switch -- -gnatm (max number or errors/warnings)
when 'm' => when 'm' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Scan_Nat (Switch_Chars, Max, Ptr, Maximum_Messages, C); Scan_Nat (Switch_Chars, Max, Ptr, Maximum_Messages, C);
-- Processing for n switch -- -gnatn (enable pragma Inline)
when 'n' => when 'n' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
...@@ -806,14 +814,14 @@ package body Switch.C is ...@@ -806,14 +814,14 @@ package body Switch.C is
end if; end if;
end if; end if;
-- Processing for N switch -- -gnatN (obsolescent)
when 'N' => when 'N' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Inline_Active := True; Inline_Active := True;
Front_End_Inlining := True; Front_End_Inlining := True;
-- Processing for o switch -- -gnato (overflow checks)
when 'o' => when 'o' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
...@@ -852,14 +860,16 @@ package body Switch.C is ...@@ -852,14 +860,16 @@ package body Switch.C is
end if; end if;
end if; end if;
-- Processing for O switch -- -gnatO (specify name of the object file)
-- This is an internal switch
when 'O' => when 'O' =>
Store_Switch := False; Store_Switch := False;
Ptr := Ptr + 1; Ptr := Ptr + 1;
Output_File_Name_Present := True; Output_File_Name_Present := True;
-- Processing for p switch -- -gnatp (suppress all checks)
when 'p' => when 'p' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
...@@ -890,32 +900,32 @@ package body Switch.C is ...@@ -890,32 +900,32 @@ package body Switch.C is
Opt.Suppress_Checks := True; Opt.Suppress_Checks := True;
end if; end if;
-- Processing for P switch -- -gnatP (periodic poll)
when 'P' => when 'P' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Polling_Required := True; Polling_Required := True;
-- Processing for q switch -- -gnatq (don't quit)
when 'q' => when 'q' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Try_Semantics := True; Try_Semantics := True;
-- Processing for Q switch -- -gnatQ (always write ALI file)
when 'Q' => when 'Q' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Force_ALI_Tree_File := True; Force_ALI_Tree_File := True;
Try_Semantics := True; Try_Semantics := True;
-- Processing for r switch -- -gnatr (restrictions as warnings)
when 'r' => when 'r' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Treat_Restrictions_As_Warnings := True; Treat_Restrictions_As_Warnings := True;
-- Processing for R switch -- -gnatR (list rep. info)
when 'R' => when 'R' =>
Back_Annotate_Rep_Info := True; Back_Annotate_Rep_Info := True;
...@@ -942,7 +952,7 @@ package body Switch.C is ...@@ -942,7 +952,7 @@ package body Switch.C is
Ptr := Ptr + 1; Ptr := Ptr + 1;
end loop; end loop;
-- Processing for s switch -- -gnats (syntax check only)
when 's' => when 's' =>
if not First_Switch then if not First_Switch then
...@@ -953,44 +963,44 @@ package body Switch.C is ...@@ -953,44 +963,44 @@ package body Switch.C is
Ptr := Ptr + 1; Ptr := Ptr + 1;
Operating_Mode := Check_Syntax; Operating_Mode := Check_Syntax;
-- Processing for S switch -- -gnatS (print package Standard)
when 'S' => when 'S' =>
Print_Standard := True; Print_Standard := True;
Ptr := Ptr + 1; Ptr := Ptr + 1;
-- Processing for t switch -- -gnatt (output tree)
when 't' => when 't' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Tree_Output := True; Tree_Output := True;
Back_Annotate_Rep_Info := True; Back_Annotate_Rep_Info := True;
-- Processing for T switch -- -gnatT (change start of internal table sizes)
when 'T' => when 'T' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Scan_Pos (Switch_Chars, Max, Ptr, Table_Factor, C); Scan_Pos (Switch_Chars, Max, Ptr, Table_Factor, C);
-- Processing for u switch -- -gnatu (list units for compilation)
when 'u' => when 'u' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
List_Units := True; List_Units := True;
-- Processing for U switch -- -gnatU (unique tags)
when 'U' => when 'U' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Unique_Error_Tag := True; Unique_Error_Tag := True;
-- Processing for v switch -- -gnatv (verbose mode)
when 'v' => when 'v' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Verbose_Mode := True; Verbose_Mode := True;
-- Processing for V switch -- -gnatV (validity checks)
when 'V' => when 'V' =>
Store_Switch := False; Store_Switch := False;
...@@ -1020,7 +1030,7 @@ package body Switch.C is ...@@ -1020,7 +1030,7 @@ package body Switch.C is
Ptr := Max + 1; Ptr := Max + 1;
-- Processing for w switch -- -gnatw (warning modes)
when 'w' => when 'w' =>
Store_Switch := False; Store_Switch := False;
...@@ -1060,7 +1070,7 @@ package body Switch.C is ...@@ -1060,7 +1070,7 @@ package body Switch.C is
return; return;
-- Processing for W switch -- -gnatW (wide character encoding method)
when 'W' => when 'W' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
...@@ -1085,13 +1095,13 @@ package body Switch.C is ...@@ -1085,13 +1095,13 @@ package body Switch.C is
Ptr := Ptr + 1; Ptr := Ptr + 1;
-- Processing for x switch -- -gnatx (suppress cross-ref information)
when 'x' => when 'x' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Xref_Active := False; Xref_Active := False;
-- Processing for X switch -- -gnatX (language extensions)
when 'X' => when 'X' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
...@@ -1099,7 +1109,7 @@ package body Switch.C is ...@@ -1099,7 +1109,7 @@ package body Switch.C is
Ada_Version := Ada_Version_Type'Last; Ada_Version := Ada_Version_Type'Last;
Ada_Version_Explicit := Ada_Version_Type'Last; Ada_Version_Explicit := Ada_Version_Type'Last;
-- Processing for y switch -- -gnaty (style checks)
when 'y' => when 'y' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
...@@ -1145,7 +1155,7 @@ package body Switch.C is ...@@ -1145,7 +1155,7 @@ package body Switch.C is
end; end;
end if; end if;
-- Processing for z switch -- -gnatz (stub generation)
when 'z' => when 'z' =>
...@@ -1185,7 +1195,7 @@ package body Switch.C is ...@@ -1185,7 +1195,7 @@ package body Switch.C is
Osint.Fail ("only one -gnatz* switch allowed"); Osint.Fail ("only one -gnatz* switch allowed");
end if; end if;
-- Processing for Z switch -- -gnatZ (obsolescent)
when 'Z' => when 'Z' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
...@@ -1196,7 +1206,7 @@ package body Switch.C is ...@@ -1196,7 +1206,7 @@ package body Switch.C is
-- version switch is added, Switch.M.Normalize_Compiler_Switches -- version switch is added, Switch.M.Normalize_Compiler_Switches
-- must be updated. -- must be updated.
-- Processing for 83 switch -- -gnat83
when '8' => when '8' =>
if Ptr = Max then if Ptr = Max then
...@@ -1213,7 +1223,7 @@ package body Switch.C is ...@@ -1213,7 +1223,7 @@ package body Switch.C is
Ada_Version_Explicit := Ada_Version; Ada_Version_Explicit := Ada_Version;
end if; end if;
-- Processing for 95 switch -- -gnat95
when '9' => when '9' =>
if Ptr = Max then if Ptr = Max then
...@@ -1230,7 +1240,7 @@ package body Switch.C is ...@@ -1230,7 +1240,7 @@ package body Switch.C is
Ada_Version_Explicit := Ada_Version; Ada_Version_Explicit := Ada_Version;
end if; end if;
-- Processing for 05 switch -- -gnat05
when '0' => when '0' =>
if Ptr = Max then if Ptr = Max then
...@@ -1247,7 +1257,7 @@ package body Switch.C is ...@@ -1247,7 +1257,7 @@ package body Switch.C is
Ada_Version_Explicit := Ada_Version; Ada_Version_Explicit := Ada_Version;
end if; end if;
-- Processing for 12 switch -- -gnat12
when '1' => when '1' =>
if Ptr = Max then if Ptr = Max then
...@@ -1264,7 +1274,7 @@ package body Switch.C is ...@@ -1264,7 +1274,7 @@ package body Switch.C is
Ada_Version_Explicit := Ada_Version; Ada_Version_Explicit := Ada_Version;
end if; end if;
-- Processing for 2005 and 2012 switches -- -gnat2005 and -gnat2012
when '2' => when '2' =>
if Ptr > Max - 3 then if Ptr > Max - 3 then
......
...@@ -167,10 +167,7 @@ begin ...@@ -167,10 +167,7 @@ begin
Write_Switch_Char ("Dnn"); Write_Switch_Char ("Dnn");
Write_Line ("Debug expanded generated code (max line length = nn)"); Write_Line ("Debug expanded generated code (max line length = nn)");
-- Line for -gnatea switch -- No line for -gnatea : internal switch
Write_Switch_Char ("ea");
Write_Line ("Delimiter for automatically added switches (internal switch)");
-- Line for -gnateA switch -- Line for -gnateA switch
...@@ -227,10 +224,7 @@ begin ...@@ -227,10 +224,7 @@ begin
Write_Switch_Char ("em=?"); Write_Switch_Char ("em=?");
Write_Line ("Specify mapping file, e.g. -gnatem=mapping"); Write_Line ("Specify mapping file, e.g. -gnatem=mapping");
-- Line for -gnateO=? -- No line for -gnateO=? : internal switch
Write_Switch_Char ("eO=?");
Write_Line ("Specify an object path file (internal switch)");
-- Line for -gnatep switch -- Line for -gnatep switch
...@@ -262,10 +256,7 @@ begin ...@@ -262,10 +256,7 @@ begin
Write_Switch_Char ("eY"); Write_Switch_Char ("eY");
Write_Line ("Ignore all Style_Checks pragmas in source"); Write_Line ("Ignore all Style_Checks pragmas in source");
-- Line for -gnatez switch -- No line for -gnatez : internal switch
Write_Switch_Char ("ez");
Write_Line ("Delimiter for automatically added switches (internal switch)");
-- Line for -gnatE switch -- Line for -gnatE switch
...@@ -355,10 +346,7 @@ begin ...@@ -355,10 +346,7 @@ begin
Write_Line Write_Line
("Set mode for general/assertion expressions separately"); ("Set mode for general/assertion expressions separately");
-- Line for -gnatO switch -- No line for -gnatO : internal switch
Write_Switch_Char ("O nm ");
Write_Line ("Set name of output ali file (internal switch)");
-- Line for -gnatp switch -- Line for -gnatp switch
......
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