This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Instantiations and subprogram declarations do not break statement SCO seq


This change ensures that a subprogram declaration or a generic instantiation
does not create a new entry point in the sequence of statement SCOs.

For the following compilation, a single statement sequence SCO line shall
be output for the declaration of X, the instantiation I, and the declaration
of Y.

$ gcc -c -gnateS inst.adb
$ grep "^CS" inst.ali | head -1
CS o3:4-3:19 i5:4-5:21 o6:4-6:19

generic
package Gen is
end Gen;

with Gen;
procedure Inst is
   X : Integer := 1;
   procedure P;
   package I is new Gen;
   Y : Integer := 1;

   procedure P is begin null; end;
begin

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

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

	* par_sco.adb (Traverse_Declarations_Or_Statements): Do not flush
	current statement sequence on a generic instantiation or a subprogram
	declaration.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]