summaryrefslogtreecommitdiff
path: root/gcc/ada/s-stoele.ads
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-02 14:30:19 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-02 14:30:19 +0000
commitc32d045231e086867f117700fbe01dbbbce3ea14 (patch)
tree86d33ed164722c539e5c03eb27ae96b8b7667e75 /gcc/ada/s-stoele.ads
parent49d882a7d8c985758c04737e801f6028d5b7240f (diff)
downloadgcc-c32d045231e086867f117700fbe01dbbbce3ea14.tar.gz
New Language: Ada
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45957 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-stoele.ads')
-rw-r--r--gcc/ada/s-stoele.ads91
1 files changed, 91 insertions, 0 deletions
diff --git a/gcc/ada/s-stoele.ads b/gcc/ada/s-stoele.ads
new file mode 100644
index 00000000000..18a170b0b2d
--- /dev/null
+++ b/gcc/ada/s-stoele.ads
@@ -0,0 +1,91 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- S Y S T E M . S T O R A G E _ E L E M E N T S --
+-- --
+-- S p e c --
+-- --
+-- $Revision: 1.23 $ --
+-- --
+-- This specification is adapted from the Ada Reference Manual for use with --
+-- GNAT. In accordance with the copyright of that document, you can freely --
+-- copy and modify this specification, provided that if you redistribute a --
+-- modified version, any changes that you have made are clearly indicated. --
+-- --
+------------------------------------------------------------------------------
+
+-- Warning: declarations in this package are ambiguous with respect to the
+-- extra declarations that can be introduced into System using Extend_System.
+-- It is a good idea to avoid use clauses for this package!
+
+pragma Warnings (Off);
+-- This is to stop bootstrap problems with the use of Inline_Always
+-- To be removed (along with redundant Inline pragmas) in 3.13.
+
+package System.Storage_Elements is
+pragma Pure (Storage_Elements);
+-- Note that we take advantage of the implementation permission to make
+-- this unit Pure instead of Preelaborable; see RM 13.7.1(15).
+
+ type Storage_Offset is range
+ -(2 ** (Standard."-" (Standard'Address_Size, 1))) ..
+ +(2 ** (Standard."-" (Standard'Address_Size, 1))) - 1;
+ -- Note: the reason for the qualification of "-" here by Standard is
+ -- that we have a current bug in GNAT that otherwise causes a bogus
+ -- ambiguity when this unit is analyzed in an Rtsfind context.
+
+ subtype Storage_Count is Storage_Offset range 0 .. Storage_Offset'Last;
+
+ type Storage_Element is mod 2 ** Storage_Unit;
+ for Storage_Element'Size use Storage_Unit;
+
+ type Storage_Array is
+ array (Storage_Offset range <>) of aliased Storage_Element;
+ for Storage_Array'Component_Size use Storage_Unit;
+
+ -- Address arithmetic
+
+ function "+" (Left : Address; Right : Storage_Offset) return Address;
+ pragma Convention (Intrinsic, "+");
+ pragma Inline ("+");
+ pragma Inline_Always ("+");
+
+ function "+" (Left : Storage_Offset; Right : Address) return Address;
+ pragma Convention (Intrinsic, "+");
+ pragma Inline ("+");
+ pragma Inline_Always ("+");
+
+ function "-" (Left : Address; Right : Storage_Offset) return Address;
+ pragma Convention (Intrinsic, "-");
+ pragma Inline ("-");
+ pragma Inline_Always ("-");
+
+ function "-" (Left, Right : Address) return Storage_Offset;
+ pragma Convention (Intrinsic, "-");
+ pragma Inline ("-");
+ pragma Inline_Always ("-");
+
+ function "mod"
+ (Left : Address;
+ Right : Storage_Offset)
+ return Storage_Offset;
+ pragma Convention (Intrinsic, "mod");
+ pragma Inline ("mod");
+ pragma Inline_Always ("mod");
+
+ -- Conversion to/from integers
+
+ type Integer_Address is mod Memory_Size;
+
+ function To_Address (Value : Integer_Address) return Address;
+ pragma Convention (Intrinsic, To_Address);
+ pragma Inline (To_Address);
+ pragma Inline_Always (To_Address);
+
+ function To_Integer (Value : Address) return Integer_Address;
+ pragma Convention (Intrinsic, To_Integer);
+ pragma Inline (To_Integer);
+ pragma Inline_Always (To_Integer);
+
+end System.Storage_Elements;