summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch13.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-18 09:34:17 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-18 09:34:17 +0000
commit2ff55065e125bf8b532dfd898e65c9eac6939ca9 (patch)
treed7fb80a81af0997f5b112651970b927c9f5380b4 /gcc/ada/sem_ch13.adb
parent2a68b2f5a9adc10291c0dac815b63a3a514e3d34 (diff)
downloadgcc-2ff55065e125bf8b532dfd898e65c9eac6939ca9.tar.gz
2014-07-18 Robert Dewar <dewar@adacore.com>
* sem_attr.adb, s-os_lib.ads, prj-tree.adb: Minor reformatting. * types.h: Fix typo. 2014-07-18 Robert Dewar <dewar@adacore.com> * freeze.adb (Check_Address_Clause): Use Kill_Rep_Clause (no functional change). * gnat_ugn.texi: Document that -gnatI removes rep clauses from ASIS trees. * sem_ch13.adb (Kill_Rep_Clause): New procedure (Analyze_Attribute_Definition_Clause): Use Kill_Rep_Clause. This is just a cleanup, no functional effect. (Analyze_Enumeration_Representation_Clause): Use Kill_Rep_Clause. This means that enum rep clauses are now properly removed from -gnatct trees. (Analyze_Record_Representation_Clause): Same change. * sem_ch13.ads (Kill_Rep_Clause): New procedure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212789 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r--gcc/ada/sem_ch13.adb32
1 files changed, 22 insertions, 10 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index a9cdc2cb533..aab0ea10df4 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -3647,19 +3647,12 @@ package body Sem_Ch13 is
Attribute_Machine_Radix |
Attribute_Object_Size |
Attribute_Size |
+ Attribute_Small |
Attribute_Stream_Size |
Attribute_Value_Size =>
- Rewrite (N, Make_Null_Statement (Sloc (N)));
+ Kill_Rep_Clause (N);
return;
- -- Perhaps 'Small should not be ignored by Ignore_Rep_Clauses ???
-
- when Attribute_Small =>
- if Ignore_Rep_Clauses then
- Rewrite (N, Make_Null_Statement (Sloc (N)));
- return;
- end if;
-
-- The following should not be ignored, because in the first place
-- they are reasonably portable, and should not cause problems in
-- compiling code from another target, and also they do affect
@@ -3676,6 +3669,13 @@ package body Sem_Ch13 is
Attribute_Write =>
null;
+ -- We do not do anything here with address clauses, they will be
+ -- removed by Freeze later on, but for now, it works better to
+ -- keep then in the tree.
+
+ when Attribute_Address =>
+ null;
+
-- Other cases are errors ("attribute& cannot be set with
-- definition clause"), which will be caught below.
@@ -3830,7 +3830,7 @@ package body Sem_Ch13 is
-- Even when ignoring rep clauses we need to indicate that the
-- entity has an address clause and thus it is legal to declare
- -- it imported.
+ -- it imported. Freeze will get rid of the address clause later.
if Ignore_Rep_Clauses then
if Ekind_In (U_Ent, E_Variable, E_Constant) then
@@ -5365,6 +5365,7 @@ package body Sem_Ch13 is
begin
if Ignore_Rep_Clauses then
+ Kill_Rep_Clause (N);
return;
end if;
@@ -5740,6 +5741,7 @@ package body Sem_Ch13 is
begin
if Ignore_Rep_Clauses then
+ Kill_Rep_Clause (N);
return;
end if;
@@ -10286,6 +10288,16 @@ package body Sem_Ch13 is
end if;
end Is_Operational_Item;
+ ---------------------
+ -- Kill_Rep_Clause --
+ ---------------------
+
+ procedure Kill_Rep_Clause (N : Node_Id) is
+ begin
+ pragma Assert (Ignore_Rep_Clauses);
+ Rewrite (N, Make_Null_Statement (Sloc (N)));
+ end Kill_Rep_Clause;
+
------------------
-- Minimum_Size --
------------------