From: Arnaud Charlet Date: Tue, 27 May 2008 11:55:54 +0000 (+0200) Subject: Replace heavy address clause by 'Unrestricted_Access... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=100a5d66a41b037c616193585d2ff0f3cbb424b7;p=gcc.git Replace heavy address clause by 'Unrestricted_Access... Replace heavy address clause by 'Unrestricted_Access, cleaner and more portable across GNAT targets, since this kind of address clause is not supported by VM back-ends (.NET/JGNAT). From-SVN: r136020 --- diff --git a/gcc/ada/a-textio.adb b/gcc/ada/a-textio.adb index c2f0f8b470e..cc5a93bb076 100644 --- a/gcc/ada/a-textio.adb +++ b/gcc/ada/a-textio.adb @@ -147,11 +147,8 @@ package body Ada.Text_IO is ----------- procedure Close (File : in out File_Type) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin - FIO.Close (AFCB'Access); + FIO.Close (AP (File)'Unrestricted_Access); end Close; --------- @@ -249,11 +246,8 @@ package body Ada.Text_IO is ------------ procedure Delete (File : in out File_Type) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin - FIO.Delete (AFCB'Access); + FIO.Delete (AP (File)'Unrestricted_Access); end Delete; ----------------- @@ -1579,9 +1573,6 @@ package body Ada.Text_IO is (File : in out File_Type; Mode : File_Mode) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin -- Don't allow change of mode for current file (RM A.10.2(5)) @@ -1594,7 +1585,7 @@ package body Ada.Text_IO is end if; Terminate_Line (File); - FIO.Reset (AFCB'Access, To_FCB (Mode)); + FIO.Reset (AP (File)'Unrestricted_Access, To_FCB (Mode)); File.Page := 1; File.Line := 1; File.Col := 1; @@ -1605,12 +1596,9 @@ package body Ada.Text_IO is end Reset; procedure Reset (File : in out File_Type) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin Terminate_Line (File); - FIO.Reset (AFCB'Access); + FIO.Reset (AP (File)'Unrestricted_Access); File.Page := 1; File.Line := 1; File.Col := 1; diff --git a/gcc/ada/a-witeio.adb b/gcc/ada/a-witeio.adb index b30c6f52753..1a4b0f5e0e7 100644 --- a/gcc/ada/a-witeio.adb +++ b/gcc/ada/a-witeio.adb @@ -133,11 +133,8 @@ package body Ada.Wide_Text_IO is ----------- procedure Close (File : in out File_Type) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin - FIO.Close (AFCB'Access); + FIO.Close (AP (File)'Unrestricted_Access); end Close; --------- @@ -235,11 +232,8 @@ package body Ada.Wide_Text_IO is ------------ procedure Delete (File : in out File_Type) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin - FIO.Delete (AFCB'Access); + FIO.Delete (AP (File)'Unrestricted_Access); end Delete; ----------------- @@ -1314,9 +1308,6 @@ package body Ada.Wide_Text_IO is (File : in out File_Type; Mode : File_Mode) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin -- Don't allow change of mode for current file (RM A.10.2(5)) @@ -1329,7 +1320,7 @@ package body Ada.Wide_Text_IO is end if; Terminate_Line (File); - FIO.Reset (AFCB'Access, To_FCB (Mode)); + FIO.Reset (AP (File)'Unrestricted_Access, To_FCB (Mode)); File.Page := 1; File.Line := 1; File.Col := 1; @@ -1340,12 +1331,9 @@ package body Ada.Wide_Text_IO is end Reset; procedure Reset (File : in out File_Type) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin Terminate_Line (File); - FIO.Reset (AFCB'Access); + FIO.Reset (AP (File)'Unrestricted_Access); File.Page := 1; File.Line := 1; File.Col := 1; diff --git a/gcc/ada/a-ztexio.adb b/gcc/ada/a-ztexio.adb index 8db57b94689..4bf70405c67 100644 --- a/gcc/ada/a-ztexio.adb +++ b/gcc/ada/a-ztexio.adb @@ -133,11 +133,8 @@ package body Ada.Wide_Wide_Text_IO is ----------- procedure Close (File : in out File_Type) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin - FIO.Close (AFCB'Access); + FIO.Close (AP (File)'Unrestricted_Access); end Close; --------- @@ -235,11 +232,8 @@ package body Ada.Wide_Wide_Text_IO is ------------ procedure Delete (File : in out File_Type) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin - FIO.Delete (AFCB'Access); + FIO.Delete (AP (File)'Unrestricted_Access); end Delete; ----------------- @@ -1314,9 +1308,6 @@ package body Ada.Wide_Wide_Text_IO is (File : in out File_Type; Mode : File_Mode) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin -- Don't allow change of mode for current file (RM A.10.2(5)) @@ -1329,7 +1320,7 @@ package body Ada.Wide_Wide_Text_IO is end if; Terminate_Line (File); - FIO.Reset (AFCB'Access, To_FCB (Mode)); + FIO.Reset (AP (File)'Unrestricted_Access, To_FCB (Mode)); File.Page := 1; File.Line := 1; File.Col := 1; @@ -1340,12 +1331,9 @@ package body Ada.Wide_Wide_Text_IO is end Reset; procedure Reset (File : in out File_Type) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); begin Terminate_Line (File); - FIO.Reset (AFCB'Access); + FIO.Reset (AP (File)'Unrestricted_Access); File.Page := 1; File.Line := 1; File.Col := 1; diff --git a/gcc/ada/s-direio.adb b/gcc/ada/s-direio.adb index fc4bd8e9d9a..328051c125a 100644 --- a/gcc/ada/s-direio.adb +++ b/gcc/ada/s-direio.adb @@ -251,21 +251,17 @@ package body System.Direct_IO is ----------- procedure Reset (File : in out File_Type; Mode : FCB.File_Mode) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); + pragma Unmodified (File); begin - FIO.Reset (AFCB'Access, Mode); + FIO.Reset (AP (File)'Unrestricted_Access, Mode); File.Index := 1; File.Last_Op := Op_Read; end Reset; procedure Reset (File : in out File_Type) is - AFCB : aliased AP; - for AFCB'Address use File'Address; - pragma Import (Ada, AFCB); + pragma Unmodified (File); begin - FIO.Reset (AFCB'Access); + FIO.Reset (AP (File)'Unrestricted_Access); File.Index := 1; File.Last_Op := Op_Read; end Reset;