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] New attribute typ'Deref (address-expr)


This attribute is equivalent to (atyp!(address-expr)).all where atyp is a
general-access-to-typ type. Right now, only the front end changes are done.
The back end needs to adapt to this change too.

The following is a test which should compile and run silently

     1. with System; use System;
     2. procedure Deref_Test is
     3.    X : Integer := 4;
     4.    Y : Address := X'Address;
     5. begin
     6.    if Integer'Deref (Y) /= 4 then
     7.       raise Program_Error;
     8.    end if;
     9. end Deref_Test;

For now it will blow up with a GCC error in the back end, which does
not know about this attribute yet.

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

2015-03-24  Robert Dewar  <dewar@adacore.com>

	* exp_attr.adb: Add entry for typ'Deref.
	* sem_attr.adb (Deref): New GNAT attribute.
	* sem_attr.ads: Add entry for new GNAT attribute Deref.
	* snames.ads-tmpl: Add entries for new attribute Deref.

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]