[Ada] Blank lines in SCO information

Message ID 20110829130816.GA1860@adacore.com
State New
Headers show

Commit Message

Arnaud Charlet Aug. 29, 2011, 1:08 p.m.
This change prevents Put_SCOs from emitting a spurious blank line in the
ALI file in case the length of a statements line is congruent to 0 modulo 6.

The following compilation must not produce any blank line in the middle of
C lines.
$ gcc -c -gnateS blank_line_in_scos.adb
package Blank_Line_In_SCOs is
   package Nest1 is
      X : Integer;
   end Nest1;
   procedure Pr;
   pragma Precondition (True);
   package Nest2 is
      Y : Integer;
   end Nest2;

   package Nest3 is
      X1 : Integer;
      X2 : Integer;
      X3 : Integer;
      X4 : Integer;
      X5 : Integer;
      X6 : Integer;
   end Nest3;

   package Nest4 is
      Z : Integer;
   end Nest4;
end Blank_Line_In_SCOs;
package body Blank_Line_In_SCOs is
   procedure Pr is begin null; end;
end Blank_Line_In_SCOs;

Tested on x86_64-pc-linux-gnu, committed on trunk

2011-08-29  Thomas Quinot  <quinot@adacore.com>

	* put_scos.adb (Put_SCOs): Do not emit a newline for an empty
	statements line.


Index: put_scos.adb
--- put_scos.adb	(revision 178164)
+++ put_scos.adb	(working copy)
@@ -178,7 +178,9 @@ 
                         pragma Assert (SCO_Table.Table (Start).C1 = 's');
                      end loop;
-                     Write_Info_Terminate;
+                     if Ctr > 0 then
+                        Write_Info_Terminate;
+                     end if;
                   --  Statement continuations should not occur since they
                   --  are supposed to have been handled in the loop above.