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] Add annotate aspect, add entity argument to pragma Annotate


An optional final named argument [Entity => local_NAME] is allowed
for pragma Annotate to indicate that the annotation is for a particular
entity, and a corresponding Annotate aspect is introduced.

Given the test program:

     1. package AspectAnn is
     2.    Y : constant Integer := 43;
     3.    X : Integer;
     4.    pragma Annotate (Hello, Goodbye, Y, Entity => X);
     5.    Z : Integer with
     6.      Annotate => (Hello, Goodbye, Y),
     7.      Annotate => Hello,
     8.      Annotate => (Goodbye);
     9. end;

Compiling with -gnatG gives:

aspectann_E : short_integer := 0;

package aspectann is
   aspectann__y : constant integer := 43;
   aspectann__x : integer;
   pragma annotate (hello, goodbye, aspectann__y, entity =>
     aspectann__x);
   aspectann__z : integer
     with annotate => (hello, goodbye, y),
          annotate => hello,
          annotate => goodbye;
   pragma annotate (hello, goodbye, aspectann__y, entity =>
     aspectann__z);
   pragma annotate (hello, entity => aspectann__z);
   pragma annotate (goodbye, entity => aspectann__z);
end aspectann;

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

2014-07-17  Robert Dewar  <dewar@adacore.com>

	* aspects.ads, aspects.adb: Add entries for aspect Annotate.
	* gnat_rm.texi: Document Entity argument for pragma Annotate and
	Annotate aspect.
	* sem_ch13.adb (Analyze_Aspect_Specification): Add processing
	for Annotate aspect.
	* sem_prag.adb (Analyze_Pragma, case Annotate): Allow optional
	Entity argument at end.
	* sinfo.ads (N_Aspect_Specification): Add note on Annotate aspect.

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]