aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/itypes.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-05 07:54:48 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-05 07:54:48 +0000
commit166ee026cdc41c3bf1b5a1379ddce8c6253b8d3b (patch)
treed7a5a8f5007bee419ecccaf73a6db9e7c78b677e /gcc/ada/itypes.adb
parent8a2fc7f3949873ca97069d89a39e48a8982b6b68 (diff)
2005-09-01 Javier Miranda <miranda@adacore.com>
* itypes.ads, itypes.adb (Create_Null_Excluding_Itype): New subprogram that given an entity T creates and returns an Itype that duplicates the contents of T. The returned Itype has the null-exclusion attribute set to True, and its Etype attribute references T to keep the association between the two entities. Update copyright notice * sem_aggr.adb (Check_Can_Never_Be_Null, Aggregate_Constraint_Checks, Resolve_Aggregate, Resolve_Array_Aggregate, Resolve_Record_Aggregate): Code cleanup. * sem_ch5.adb (Analyze_Assignment): Code cleanup. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103868 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/itypes.adb')
-rw-r--r--gcc/ada/itypes.adb40
1 files changed, 37 insertions, 3 deletions
diff --git a/gcc/ada/itypes.adb b/gcc/ada/itypes.adb
index dd06bd7cabd..f9f86d57e2e 100644
--- a/gcc/ada/itypes.adb
+++ b/gcc/ada/itypes.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -25,10 +25,8 @@
------------------------------------------------------------------------------
with Atree; use Atree;
-with Einfo; use Einfo;
with Opt; use Opt;
with Sem; use Sem;
-with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Stand; use Stand;
@@ -74,4 +72,40 @@ package body Itypes is
return Typ;
end Create_Itype;
+ ---------------------------------
+ -- Create_Null_Excluding_Itype --
+ ---------------------------------
+
+ function Create_Null_Excluding_Itype
+ (T : Entity_Id;
+ Related_Nod : Node_Id;
+ Scope_Id : Entity_Id := Current_Scope) return Entity_Id
+ is
+ I_Typ : Entity_Id;
+
+ begin
+ pragma Assert (Is_Access_Type (T));
+
+ I_Typ := Create_Itype (Ekind => E_Access_Subtype,
+ Related_Nod => Related_Nod,
+ Scope_Id => Scope_Id);
+
+ Set_Directly_Designated_Type (I_Typ,
+ Directly_Designated_Type (T));
+ Set_Etype (I_Typ, T);
+ Init_Size_Align (I_Typ);
+ Set_Depends_On_Private (I_Typ, Depends_On_Private (T));
+ Set_Is_Public (I_Typ, Is_Public (T));
+ Set_From_With_Type (I_Typ, From_With_Type (T));
+ Set_Is_Access_Constant (I_Typ, Is_Access_Constant (T));
+ Set_Is_Generic_Type (I_Typ, Is_Generic_Type (T));
+ Set_Is_Volatile (I_Typ, Is_Volatile (T));
+ Set_Treat_As_Volatile (I_Typ, Treat_As_Volatile (T));
+ Set_Is_Atomic (I_Typ, Is_Atomic (T));
+ Set_Is_Ada_2005 (I_Typ, Is_Ada_2005 (T));
+ Set_Can_Never_Be_Null (I_Typ);
+
+ return I_Typ;
+ end Create_Null_Excluding_Itype;
+
end Itypes;