]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gnat_ugn.texi: Document -gnatDnn/-gnatGnn
authorRobert Dewar <dewar@adacore.com>
Tue, 7 Apr 2009 14:52:29 +0000 (14:52 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 7 Apr 2009 14:52:29 +0000 (16:52 +0200)
2009-04-07  Robert Dewar  <dewar@adacore.com>

* gnat_ugn.texi: Document -gnatDnn/-gnatGnn

* opt.ads (Sprint_Line_Limit): New parameter

* sprint.adb: Usa Sprint_Line_Limit instead of Line_Limit throughout

* switch-c.adb: Recognize -gnatDnnn and -gnatGnnn switches

* usage.adb: Output information for -gnatGnn -gnatDnn

* make.adb: Minor reformatting

* mlib-tgt-specific-vms-alpha.adb: Minor reformatting

* mlib-tgt-specific-vms-ia64.adb: Minor reformatting

From-SVN: r145677

gcc/ada/ChangeLog
gcc/ada/gnat_ugn.texi
gcc/ada/make.adb
gcc/ada/mlib-tgt-specific-vms-alpha.adb
gcc/ada/mlib-tgt-specific-vms-ia64.adb
gcc/ada/opt.ads
gcc/ada/sprint.adb
gcc/ada/switch-c.adb
gcc/ada/usage.adb

index 0bf73e7e8ac229cc338635e46e6c43ef985833aa..ea28b0e30aa7cb1f969e1d997ce88ea81a8a67b4 100644 (file)
@@ -1,3 +1,27 @@
+2009-04-07  Robert Dewar  <dewar@adacore.com>
+
+       * gnat_ugn.texi: Document -gnatDnn/-gnatGnn
+
+       * opt.ads (Sprint_Line_Limit): New parameter
+       
+       * sprint.adb: Usa Sprint_Line_Limit instead of Line_Limit throughout
+       
+       * switch-c.adb: Recognize -gnatDnnn and -gnatGnnn switches
+       
+       * usage.adb: Output information for -gnatGnn -gnatDnn
+
+2009-04-07  Robert Dewar  <dewar@adacore.com>
+
+       * make.adb: Minor reformatting
+
+2009-04-07  Robert Dewar  <dewar@adacore.com>
+
+       * mlib-tgt-specific-vms-alpha.adb: Minor reformatting
+
+2009-04-07  Robert Dewar  <dewar@adacore.com>
+
+       * mlib-tgt-specific-vms-ia64.adb: Minor reformatting
+
 2009-04-07  Robert Dewar  <dewar@adacore.com>
 
        * checks.adb:
index 78cca2843e4acc98bce702ba20b23cedb56a474c..50ccad47a2195f4cee4f0e7809a00c1cb7359aad 100644 (file)
@@ -3886,7 +3886,7 @@ programmers, and these are documented at appropriate points in this
 users guide.
 
 @item -gnatD
-@cindex @option{-gnatD} (@command{gcc})
+@cindex @option{-gnatD[nn]} (@command{gcc})
 Create expanded source files for source level debugging. This switch
 also suppress generation of cross-reference information
 (see @option{-gnatx}).
@@ -3952,8 +3952,8 @@ Note that @option{^-gnatg^/GNAT_INTERNAL^} implies
 so that all standard warnings and all standard style options are turned on.
 All warnings and style error messages are treated as errors.
 
-@item -gnatG
-@cindex @option{-gnatG} (@command{gcc})
+@item -gnatGnn
+@cindex @option{-gnatG[nn]} (@command{gcc})
 List generated expanded code in source form.
 
 @item ^-gnath^/HELP^
@@ -6781,7 +6781,7 @@ switches in the body of the @code{Debug} unit in the compiler source
 file @file{debug.adb}.
 @end ifclear
 
-@item -gnatG
+@item -gnatG[nn]
 @cindex @option{-gnatG} (@command{gcc})
 This switch causes the compiler to generate auxiliary output containing
 a pseudo-source listing of the generated expanded code. Like most Ada
@@ -6796,6 +6796,11 @@ generate a lot of run-time code. By using @option{-gnatG} you can identify
 these cases, and consider whether it may be desirable to modify the coding
 approach to improve efficiency.
 
+The optional parameter @code{nn} if present after -gnatG specifies an
+alternative maximum line length that overrides the normal default of 72.
+This value is in the range 40-999999, values less than 40 being silently
+reset to 40.
+
 The format of the output is very similar to standard Ada source, and is
 easily understood by an Ada programmer. The following special syntactic
 additions correspond to low level features used in the generated code that
@@ -6879,7 +6884,7 @@ representation in base 2-16 (for example, the result of compile time
 evaluation of the expression 1.0/27.0).
 @end table
 
-@item -gnatD
+@item -gnatD[nn]
 @cindex @option{-gnatD} (@command{gcc})
 When used in conjunction with @option{-gnatG}, this switch causes
 the expanded source, as described above for
@@ -6907,6 +6912,11 @@ If the switch @option{-gnatL} is used in conjunction with
 @option{-gnatDG}, then the original source lines are interspersed
 in the expanded source (as comment lines with the original line number).
 
+The optional parameter @code{nn} if present after -gnatD specifies an
+alternative maximum line length that overrides the normal default of 72.
+This value is in the range 40-999999, values less than 40 being silently
+reset to 40.
+
 @item -gnatr
 @cindex @option{-gnatr} (@command{gcc})
 @cindex pragma Restrictions
index f79cbe5f0e8600209b47793b03a8d35a9bea5258..3df5482f28ebb509f71e81226015954d1a6d9939 100644 (file)
@@ -1888,7 +1888,7 @@ package body Make is
                         return;
                      end if;
 
-                     --  Do the same check for each of the withed units.
+                     --  Do the same check for each of the withed units
 
                      W_Check :
                      for W in Units.Table (U).First_With
index f272307b9359e4dd7cd3891f3b3ada8da0c013cb..0c4ab953f33177b8888c3956704f83c107eed862 100644 (file)
@@ -46,7 +46,7 @@ with System.CRTL;      use System.CRTL;
 
 package body MLib.Tgt.Specific is
 
-   --  Non default subprogram. See comment in mlib-tgt.ads.
+   --  Non default subprogram. See comment in mlib-tgt.ads
 
    procedure Build_Dynamic_Library
      (Ofiles       : Argument_List;
index ed483876be4bbd9b87026b865846d5e07fd0e1f8..c133ef0d4b5d1bcac423e6b7fa2b5818b9798cb5 100644 (file)
@@ -46,7 +46,7 @@ with System.CRTL;      use System.CRTL;
 
 package body MLib.Tgt.Specific is
 
-   --  Non default subprogram. See comment in mlib-tgt.ads.
+   --  Non default subprogram, see comment in mlib-tgt.ads
 
    procedure Build_Dynamic_Library
      (Ofiles       : Argument_List;
index 810f4d5c8138c9cc27a6b878719bea1f411503bf..1aba6eb0d538ffe1e5f8cf0d452295b21c9b7fb0 100644 (file)
@@ -1024,6 +1024,10 @@ package Opt is
    --  option for GNATBIND and to False when using the -static option. The
    --  value of this flag is set by Gnatbind.Scan_Bind_Arg.
 
+   Sprint_Line_Limit : Nat := 72;
+   --  Limit values for chopping long lines in Sprint output, can be reset
+   --  by use of NNN parameter with -gnatG or -gnatD switches.
+
    Stack_Checking_Enabled : Boolean;
    --  GNAT
    --  Set to indicate if -fstack-check switch is set for the compilation. True
index ad20565574fa803c0f409fc1a572e56663c94603..1ea8bac1e486f3cb7b05d6e1b03d409a2c36109b 100644 (file)
@@ -87,9 +87,6 @@ package body Sprint is
    --  This keeps track of the physical line number of the last source line
    --  that has been output. The value is only valid in Dump_Source_Text mode.
 
-   Line_Limit : constant := 72;
-   --  Limit value for chopping long lines
-
    -------------------------------
    -- Operator Precedence Table --
    -------------------------------
@@ -355,7 +352,7 @@ package body Sprint is
 
    procedure Col_Check (N : Nat) is
    begin
-      if N + Column > Line_Limit then
+      if N + Column > Sprint_Line_Limit then
          Write_Indent_Str ("  ");
       end if;
    end Col_Check;
@@ -1119,7 +1116,7 @@ package body Sprint is
             Sprint_Indented_List (Statements (Node));
 
          when N_Character_Literal =>
-            if Column > 70 then
+            if Column > Sprint_Line_Limit - 2 then
                Write_Indent_Str ("  ");
             end if;
 
@@ -2723,7 +2720,7 @@ package body Sprint is
             Write_Char (')');
 
          when N_String_Literal =>
-            if String_Length (Strval (Node)) + Column > 75 then
+            if String_Length (Strval (Node)) + Column > Sprint_Line_Limit then
                Write_Indent_Str ("  ");
             end if;
 
@@ -4216,7 +4213,7 @@ package body Sprint is
 
    procedure Write_Str_With_Col_Check (S : String) is
    begin
-      if Int (S'Last) + Column > Line_Limit then
+      if Int (S'Last) + Column > Sprint_Line_Limit then
          Write_Indent_Str ("  ");
 
          if S (S'First) = ' ' then
@@ -4236,7 +4233,7 @@ package body Sprint is
 
    procedure Write_Str_With_Col_Check_Sloc (S : String) is
    begin
-      if Int (S'Last) + Column > Line_Limit then
+      if Int (S'Last) + Column > Sprint_Line_Limit then
          Write_Indent_Str ("  ");
 
          if S (S'First) = ' ' then
index 0da8f6671f2ff15ee0cd8d1dfc6e7f66316f8116..a7299ab29fa247a00e1436d53e7ca763311dc0be 100644 (file)
@@ -279,6 +279,13 @@ package body Switch.C is
             when 'D' =>
                Ptr := Ptr + 1;
 
+               --  Scan option integer line limit value
+
+               if Ptr <= Max and then Switch_Chars (Ptr) in '0' .. '9' then
+                  Scan_Nat (Switch_Chars, Max, Ptr, Sprint_Line_Limit, 'D');
+                  Sprint_Line_Limit := Nat'Max (Sprint_Line_Limit, 40);
+               end if;
+
                --  Note: -gnatD also sets -gnatx (to turn off cross-reference
                --  generation in the ali file) since otherwise this generation
                --  gets confused by the "wrong" Sloc values put in the tree.
@@ -522,6 +529,13 @@ package body Switch.C is
                Ptr := Ptr + 1;
                Print_Generated_Code := True;
 
+               --  Scan option integer line limit value
+
+               if Ptr <= Max and then Switch_Chars (Ptr) in '0' .. '9' then
+                  Scan_Nat (Switch_Chars, Max, Ptr, Sprint_Line_Limit, 'G');
+                  Sprint_Line_Limit := Nat'Max (Sprint_Line_Limit, 40);
+               end if;
+
             --  Processing for h switch
 
             when 'h' =>
index b2fe13a0993533ba39c32c3ffc6d0d431b2c0ea1..de3d57931dd5121b530131852ecfbb864617eef5 100644 (file)
@@ -155,7 +155,9 @@ begin
    --  Line for -gnatD switch
 
    Write_Switch_Char ("D");
-   Write_Line ("Debug expanded generated code rather than source code");
+   Write_Line ("Debug expanded generated code (max line length = 72)");
+   Write_Switch_Char ("Dnn");
+   Write_Line ("Debug expanded generated code (max line length = nnn)");
 
    --  Line for -gnatec switch
 
@@ -212,10 +214,12 @@ begin
    Write_Switch_Char ("g");
    Write_Line ("GNAT implementation mode (used for compiling GNAT units)");
 
-   --  Line for -gnatG switch
+   --  Lines for -gnatG switch
 
    Write_Switch_Char ("G");
-   Write_Line ("Output generated expanded code in source form");
+   Write_Line ("Output generated expanded code (max line length = 72)");
+   Write_Switch_Char ("Gnn");
+   Write_Line ("Output generated expanded code (max line length = nn)");
 
    --  Line for -gnath switch