summaryrefslogtreecommitdiff
path: root/gcc/ada/a-tags.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-14 08:44:53 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-14 08:44:53 +0000
commit1229aa51302402029897d06bef1cface5f6c199f (patch)
tree57ff8ef3f27de425565772583668292443f40cb5 /gcc/ada/a-tags.adb
parent8620a40656d663e1c918aed09b7a1a92f0343efa (diff)
downloadgcc-1229aa51302402029897d06bef1cface5f6c199f.tar.gz
2007-08-14 Javier Miranda <miranda@adacore.com>
* a-tags.ads, a-tags.adb (Displace): Associate a message with the raised CE exception. (To_Addr_Ptr, To_Address, To_Dispatch_Table_Ptr, To_Object_Specific_Data_Ptr To_Predef_Prims_Ptr, To_Tag_Ptr, To_Type_Specific_Data_Ptr): Moved here from the package spec. (Default_Prim_Op_Count): Removed. (IW_Membership, Get_Entry_Index, Get_Offset_Index, Get_Prim_Op_Kind, Register_Tag, Set_Entry_Index, Set_Offset_To_Top, Set_Prim_Op_Kind): Remove pragma Inline_Always. * rtsfind.ads (Default_Prim_Op_Count): Removed (Max_Predef_Prims): New entity (RE_Expanded_Name): Removed (RE_HT_Link): Removed (RE_Iface_Tag): Remmoved (RE_Ifaces_Table): Removed (RE_Interfaces_Array): Removed (RE_Interface_Data_Element): Removed (RE_Nb_Ifaces): Removed (RE_RC_Offset): Removed (RE_Static_Offset_To_Top): Removed * exp_atag.ads (Build_Inherit_Prims): Addition of a new formal. (Build_Inherit_Predefined_Prims): Replace occurrences of Default_ Prim_Op_Count by Max_Predef_Prims. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127438 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-tags.adb')
-rw-r--r--gcc/ada/a-tags.adb37
1 files changed, 27 insertions, 10 deletions
diff --git a/gcc/ada/a-tags.adb b/gcc/ada/a-tags.adb
index 622087a08ad..5a0cf71494a 100644
--- a/gcc/ada/a-tags.adb
+++ b/gcc/ada/a-tags.adb
@@ -32,6 +32,7 @@
------------------------------------------------------------------------------
with Ada.Exceptions;
+with Ada.Unchecked_Conversion;
with System.HTable;
with System.Storage_Elements; use System.Storage_Elements;
with System.WCh_Con; use System.WCh_Con;
@@ -76,9 +77,7 @@ package body Ada.Tags is
pragma Inline_Always (OSD);
pragma Inline_Always (SSD);
- ---------------------------------------------
- -- Unchecked Conversions for String Fields --
- ---------------------------------------------
+ -- Unchecked conversions
function To_Address is
new Unchecked_Conversion (Cstring_Ptr, System.Address);
@@ -86,16 +85,34 @@ package body Ada.Tags is
function To_Cstring_Ptr is
new Unchecked_Conversion (System.Address, Cstring_Ptr);
- -- Disable warnings on possible aliasing problem because we only use
- -- use this function to convert tags found in the External_Tag of
- -- locally defined tagged types.
-
- pragma Warnings (off);
+ -- Disable warnings on possible aliasing problem
function To_Tag is
new Unchecked_Conversion (Integer_Address, Tag);
- pragma Warnings (on);
+ function To_Addr_Ptr is
+ new Ada.Unchecked_Conversion (System.Address, Addr_Ptr);
+
+ function To_Address is
+ new Ada.Unchecked_Conversion (Tag, System.Address);
+
+ function To_Dispatch_Table_Ptr is
+ new Ada.Unchecked_Conversion (Tag, Dispatch_Table_Ptr);
+
+ function To_Dispatch_Table_Ptr is
+ new Ada.Unchecked_Conversion (System.Address, Dispatch_Table_Ptr);
+
+ function To_Object_Specific_Data_Ptr is
+ new Ada.Unchecked_Conversion (System.Address, Object_Specific_Data_Ptr);
+
+ function To_Predef_Prims_Table_Ptr is
+ new Ada.Unchecked_Conversion (System.Address, Predef_Prims_Table_Ptr);
+
+ function To_Tag_Ptr is
+ new Ada.Unchecked_Conversion (System.Address, Tag_Ptr);
+
+ function To_Type_Specific_Data_Ptr is
+ new Ada.Unchecked_Conversion (System.Address, Type_Specific_Data_Ptr);
------------------------------------------------
-- Unchecked Conversions for other components --
@@ -357,7 +374,7 @@ package body Ada.Tags is
-- If the object does not implement the interface we must raise CE
- raise Constraint_Error;
+ raise Constraint_Error with "invalid interface conversion";
end Displace;
--------