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] Omit statement SCO for disabled pragma


This change ensures that no statement SCO is emitted for a disabled pragma.

For the following compilation, the CS line shall contain only one entry
(for the assignment statement), and no entry for the (disabled) pragma Assert.

$ gcc -c -gnateS plop.adb
$ grep ^C plop.ali
C 1 plop.adb
CS 8:4-8:15

and when using -gnata, a P statement entry shall be generated, and in addition
a CP decision line:

$ gcc -c -gnateS -gnata plop.adb
$ grep ^C plop.ali
C 3 plop.adb
CS P7:4-7:28 8:4-8:15
CP 7:4 c7:19-7:28

procedure Plop
  (X, Y : Integer;
   Sum  : out Integer;
   UB   : Integer)
is
begin
   pragma Assert (X + Y <= UB);
   Sum := X + Y; 
end;

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

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

	* par_sco.adb (Traverse_Declarations_Or_Statements.Set_Statement_Entry):
	For a pragma (statement with C1 = 'P'), record the sloc of the pragma.
	* scos.ads: Update documentation accordingly.
	* put_scos.adb (Output_SCO_Line): Omit statement SCOs for disabled
	pragmas.

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]