diff options
author | Arnaud Charlet <charlet@adacore.com> | 2021-05-25 04:18:21 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-07-08 13:34:17 +0000 |
commit | c5b1e8e9a5808d612ad20fdf2f77c52cfa5907d3 (patch) | |
tree | a1772da6d631e0f11e36b82a33329458c5dc0272 | |
parent | a2f91a52b4b989b52f0ccdabc2d9aead05c8056b (diff) | |
download | gcc-c5b1e8e9a5808d612ad20fdf2f77c52cfa5907d3.zip gcc-c5b1e8e9a5808d612ad20fdf2f77c52cfa5907d3.tar.gz gcc-c5b1e8e9a5808d612ad20fdf2f77c52cfa5907d3.tar.bz2 |
[Ada] Make runtime code compatible with No_Dynamic_Accessibility_Checks
gcc/ada/
* libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb,
libgnat/a-cbhase.adb, libgnat/a-cbmutr.adb,
libgnat/a-cborma.adb, libgnat/a-cborse.adb,
libgnat/a-cobove.adb, libgnat/a-textio.adb,
libgnat/a-witeio.adb, libgnat/a-ztexio.adb: Make code compatible
with No_Dynamic_Accessibility_Checks restriction.
-rw-r--r-- | gcc/ada/libgnat/a-cbdlli.adb | 4 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-cbhama.adb | 8 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-cbhase.adb | 4 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-cbmutr.adb | 4 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-cborma.adb | 8 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-cborse.adb | 8 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-cobove.adb | 8 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-textio.adb | 13 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-witeio.adb | 13 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-ztexio.adb | 13 |
10 files changed, 40 insertions, 43 deletions
diff --git a/gcc/ada/libgnat/a-cbdlli.adb b/gcc/ada/libgnat/a-cbdlli.adb index bb92bda..143805e 100644 --- a/gcc/ada/libgnat/a-cbdlli.adb +++ b/gcc/ada/libgnat/a-cbdlli.adb @@ -312,7 +312,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -1608,7 +1608,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); diff --git a/gcc/ada/libgnat/a-cbhama.adb b/gcc/ada/libgnat/a-cbhama.adb index 78a590f..26c01f5 100644 --- a/gcc/ada/libgnat/a-cbhama.adb +++ b/gcc/ada/libgnat/a-cbhama.adb @@ -213,7 +213,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -239,7 +239,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -1028,7 +1028,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -1053,7 +1053,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); diff --git a/gcc/ada/libgnat/a-cbhase.adb b/gcc/ada/libgnat/a-cbhase.adb index f8ca4d2..d6ab353 100644 --- a/gcc/ada/libgnat/a-cbhase.adb +++ b/gcc/ada/libgnat/a-cbhase.adb @@ -232,7 +232,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -1643,7 +1643,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); diff --git a/gcc/ada/libgnat/a-cbmutr.adb b/gcc/ada/libgnat/a-cbmutr.adb index 714dea1..e80eb5c 100644 --- a/gcc/ada/libgnat/a-cbmutr.adb +++ b/gcc/ada/libgnat/a-cbmutr.adb @@ -600,7 +600,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => Container.Elements (Position.Node)'Access, + (Element => Container.Elements (Position.Node)'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -2533,7 +2533,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => Container.Elements (Position.Node)'Access, + (Element => Container.Elements (Position.Node)'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); diff --git a/gcc/ada/libgnat/a-cborma.adb b/gcc/ada/libgnat/a-cborma.adb index 67e6108..f26a1e3 100644 --- a/gcc/ada/libgnat/a-cborma.adb +++ b/gcc/ada/libgnat/a-cborma.adb @@ -420,7 +420,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -445,7 +445,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -1417,7 +1417,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -1442,7 +1442,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); diff --git a/gcc/ada/libgnat/a-cborse.adb b/gcc/ada/libgnat/a-cborse.adb index 0b9e0cc..5c9a86e 100644 --- a/gcc/ada/libgnat/a-cborse.adb +++ b/gcc/ada/libgnat/a-cborse.adb @@ -420,7 +420,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -752,7 +752,7 @@ is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -943,7 +943,7 @@ is N : Node_Type renames Container.Nodes (Position.Node); begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with Container.TC'Unrestricted_Access, @@ -971,7 +971,7 @@ is N : Node_Type renames Container.Nodes (Node); begin return R : constant Reference_Type := - (Element => N.Element'Access, + (Element => N.Element'Unchecked_Access, Control => (Controlled with Container.TC'Unrestricted_Access, diff --git a/gcc/ada/libgnat/a-cobove.adb b/gcc/ada/libgnat/a-cobove.adb index f32afa1..e56cb94 100644 --- a/gcc/ada/libgnat/a-cobove.adb +++ b/gcc/ada/libgnat/a-cobove.adb @@ -415,7 +415,7 @@ package body Ada.Containers.Bounded_Vectors is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => A (J)'Access, + (Element => A (J)'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -439,7 +439,7 @@ package body Ada.Containers.Bounded_Vectors is Container.TC'Unrestricted_Access; begin return R : constant Constant_Reference_Type := - (Element => A (J)'Access, + (Element => A (J)'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -2238,7 +2238,7 @@ package body Ada.Containers.Bounded_Vectors is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => A (J)'Access, + (Element => A (J)'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); @@ -2262,7 +2262,7 @@ package body Ada.Containers.Bounded_Vectors is Container.TC'Unrestricted_Access; begin return R : constant Reference_Type := - (Element => A (J)'Access, + (Element => A (J)'Unchecked_Access, Control => (Controlled with TC)) do Busy (TC.all); diff --git a/gcc/ada/libgnat/a-textio.adb b/gcc/ada/libgnat/a-textio.adb index dc67091..717f529 100644 --- a/gcc/ada/libgnat/a-textio.adb +++ b/gcc/ada/libgnat/a-textio.adb @@ -171,15 +171,15 @@ is -- is required (RM A.10.3(23)) but it seems reasonable, and besides -- ACVC test CE3208A expects this behavior. - if File_Type (File) = Current_In then + if File = Current_In then Current_In := null; - elsif File_Type (File) = Current_Out then + elsif File = Current_Out then Current_Out := null; - elsif File_Type (File) = Current_Err then + elsif File = Current_Err then Current_Err := null; end if; - Terminate_Line (File_Type (File)); + Terminate_Line (File.all'Access); end AFCB_Close; --------------- @@ -187,10 +187,9 @@ is --------------- procedure AFCB_Free (File : not null access Text_AFCB) is - type FCB_Ptr is access all Text_AFCB; - FT : FCB_Ptr := FCB_Ptr (File); + FT : File_Type := File.all'Access; - procedure Free is new Ada.Unchecked_Deallocation (Text_AFCB, FCB_Ptr); + procedure Free is new Ada.Unchecked_Deallocation (Text_AFCB, File_Type); begin Free (FT); diff --git a/gcc/ada/libgnat/a-witeio.adb b/gcc/ada/libgnat/a-witeio.adb index dbd3fc8..7dbd3b3 100644 --- a/gcc/ada/libgnat/a-witeio.adb +++ b/gcc/ada/libgnat/a-witeio.adb @@ -136,15 +136,15 @@ package body Ada.Wide_Text_IO is -- is required (RM A.10.3(23)) but it seems reasonable, and besides -- ACVC test CE3208A expects this behavior. - if File_Type (File) = Current_In then + if File = Current_In then Current_In := null; - elsif File_Type (File) = Current_Out then + elsif File = Current_Out then Current_Out := null; - elsif File_Type (File) = Current_Err then + elsif File = Current_Err then Current_Err := null; end if; - Terminate_Line (File_Type (File)); + Terminate_Line (File.all'Access); end AFCB_Close; --------------- @@ -152,11 +152,10 @@ package body Ada.Wide_Text_IO is --------------- procedure AFCB_Free (File : not null access Wide_Text_AFCB) is - type FCB_Ptr is access all Wide_Text_AFCB; - FT : FCB_Ptr := FCB_Ptr (File); + FT : File_Type := File.all'Access; procedure Free is - new Ada.Unchecked_Deallocation (Wide_Text_AFCB, FCB_Ptr); + new Ada.Unchecked_Deallocation (Wide_Text_AFCB, File_Type); begin Free (FT); diff --git a/gcc/ada/libgnat/a-ztexio.adb b/gcc/ada/libgnat/a-ztexio.adb index 0dfabd5..71d733e 100644 --- a/gcc/ada/libgnat/a-ztexio.adb +++ b/gcc/ada/libgnat/a-ztexio.adb @@ -136,15 +136,15 @@ package body Ada.Wide_Wide_Text_IO is -- is required (RM A.10.3(23)) but it seems reasonable, and besides -- ACVC test CE3208A expects this behavior. - if File_Type (File) = Current_In then + if File = Current_In then Current_In := null; - elsif File_Type (File) = Current_Out then + elsif File = Current_Out then Current_Out := null; - elsif File_Type (File) = Current_Err then + elsif File = Current_Err then Current_Err := null; end if; - Terminate_Line (File_Type (File)); + Terminate_Line (File.all'Access); end AFCB_Close; --------------- @@ -152,11 +152,10 @@ package body Ada.Wide_Wide_Text_IO is --------------- procedure AFCB_Free (File : not null access Wide_Wide_Text_AFCB) is - type FCB_Ptr is access all Wide_Wide_Text_AFCB; - FT : FCB_Ptr := FCB_Ptr (File); + FT : File_Type := File.all'Access; procedure Free is new - Ada.Unchecked_Deallocation (Wide_Wide_Text_AFCB, FCB_Ptr); + Ada.Unchecked_Deallocation (Wide_Wide_Text_AFCB, File_Type); begin Free (FT); |