aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/types.ads
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-04-25 17:54:39 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2017-04-25 17:54:39 +0200
commit211e7410b32e6cb4b45d414883c5d6d5f37faa31 (patch)
tree55dae71c0ef21060e28548eed6b71f8e8f1b0965 /gcc/ada/types.ads
parentf66c70dc0392cfa06f6414a8b9fa65adb9051b58 (diff)
downloadgcc-211e7410b32e6cb4b45d414883c5d6d5f37faa31.zip
gcc-211e7410b32e6cb4b45d414883c5d6d5f37faa31.tar.gz
gcc-211e7410b32e6cb4b45d414883c5d6d5f37faa31.tar.bz2
[multiple changes]
2017-04-25 Arnaud Charlet <charlet@adacore.com> * exp_ch4.adb (Expand_N_Case_Expression): Emit error message when generating C code on complex case expressions. 2017-04-25 Arnaud Charlet <charlet@adacore.com> * sem_prag.adb (Analyze_Pragma): Generate a warning instead of silently ignoring pragma Ada_xxx in Latest_Ada_Only mode. * directio.ads, ioexcept.ads, sequenio.ads, text_io.ads: Use Ada_2012 instead of Ada_2005 to be compatible with the above change. * bindgen.adb: Silence new warning on pragma Ada_95. 2017-04-25 Hristian Kirtchev <kirtchev@adacore.com> * checks.adb (Generate_Range_Check): Revert part of previous change. 2017-04-25 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Try_Container_Indexing): Handle properly a container indexing operation that appears as a an actual in a parameter association in a procedure call. 2017-04-25 Olivier Ramonat <ramonat@adacore.com> * prj-proc.adb, sem_util.adb, s-stposu.adb, sem_attr.adb, prj-conf.ads: Fix spelling mistakes. 2017-04-25 Bob Duff <duff@adacore.com> * types.ads, osint.adb, sinput-c.adb, sinput-d.adb, sinput-l.adb, * sinput-p.adb: Use regular fat pointers, with bounds checking, for source buffers. Fix misc obscure bugs. * sinput.ads, sinput.adb: Use regular fat pointers, with bounds checking, for source buffers. Modify representation clause for Source_File_Record as appropriate. Move Source_File_Index_Table from spec to body, because it is not used outside the body. Move Set_Source_File_Index_Table into the private part, because it is used only in the body and in children. Use trickery to modify the dope in the generic instantiation case. It's ugly, but not as ugly as the previous method. Fix documentation. Remove obsolete code. * fname-sf.adb, targparm.adb: Fix misc out-of-bounds indexing in source buffers. * fmap.adb: Avoid conversions from one string type to another. Remove a use of global name buffer. * osint.ads, sfn_scan.ads, sfn_scan.adb, sinput-c.ads: Comment fixes. From-SVN: r247252
Diffstat (limited to 'gcc/ada/types.ads')
-rw-r--r--gcc/ada/types.ads32
1 files changed, 12 insertions, 20 deletions
diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads
index 1ae0f9b..e0809f2 100644
--- a/gcc/ada/types.ads
+++ b/gcc/ada/types.ads
@@ -196,23 +196,14 @@ package Types is
-- which are one greater than the previous upper bound, rounded up to
-- a multiple of Source_Align.
- subtype Big_Source_Buffer is Text_Buffer (0 .. Text_Ptr'Last);
- -- This is a virtual type used as the designated type of the access type
- -- Source_Buffer_Ptr, see Osint.Read_Source_File for details.
-
- type Source_Buffer_Ptr is access constant Big_Source_Buffer;
- -- Pointer to source buffer. We use virtual origin addressing for source
- -- buffers, with thin pointers. The pointer points to a virtual instance
- -- of type Big_Source_Buffer, where the actual type is in fact of type
- -- Source_Buffer. The address is adjusted so that the virtual origin
- -- addressing works correctly. See Osint.Read_Source_Buffer for further
- -- details. Again, as for Big_String_Ptr, we should never allocate using
- -- this type, but we don't give a storage size clause of zero, since we
- -- may end up doing deallocations of instances allocated manually.
+ type Source_Buffer_Ptr_Var is access all Source_Buffer;
+ type Source_Buffer_Ptr is access constant Source_Buffer;
+ -- Pointer to source buffer. Source_Buffer_Ptr_Var is used for allocation
+ -- and deallocation; Source_Buffer_Ptr is used for all other uses of source
+ -- buffers.
function Null_Source_Buffer_Ptr (X : Source_Buffer_Ptr) return Boolean;
- -- True if X = null. ???This usage of "=" is wrong, because the zero-origin
- -- pointer could happen to be equal to null. We need to eliminate this.
+ -- True if X = null
function Source_Buffer_Ptr_Equal (X, Y : Source_Buffer_Ptr) return Boolean
renames "=";
@@ -220,10 +211,11 @@ package Types is
-- Do not call this elsewhere.
function "=" (X, Y : Source_Buffer_Ptr) return Boolean is abstract;
- -- Make "=" abstract, to make sure no one calls it. Note that this makes
- -- "/=" abstract as well. Calls to "=" on Source_Buffer_Ptr are always
- -- wrong, because two different arrays allocated at two different addresses
- -- can have the same virtual origin.
+ -- Make "=" abstract. Note that this makes "/=" abstract as well. This is a
+ -- vestige of the zero-origin array indexing we used to use, where "=" is
+ -- always wrong (including the one in Null_Source_Buffer_Ptr). We keep this
+ -- just because we never need to compare Source_Buffer_Ptrs other than to
+ -- null.
subtype Source_Ptr is Text_Ptr;
-- Type used to represent a source location, which is a subscript of a
@@ -580,7 +572,7 @@ package Types is
No_Unit : constant Unit_Number_Type := -1;
-- Special value used to signal no unit
- type Source_File_Index is new Int range -1 .. Int'Last;
+ type Source_File_Index is new Int range 0 .. Int'Last;
-- Type used to index the source file table (see package Sinput)
No_Source_File : constant Source_File_Index := 0;