From 638f50548143c46e32bca3b9e38bfc8e9251672b Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 26 Oct 2015 13:03:29 +0100 Subject: [PATCH] [multiple changes] 2015-10-26 Javier Miranda * exp_ch6.adb (Expand_N_Subprogram_Declaration): Skip the frontend transformation of functions that return a constrained array into a procedure when they are unchecked_conversion instances. 2015-10-26 Gary Dismukes * s-os_lib.ads: Minor reformatting/rewording. From-SVN: r229350 --- gcc/ada/ChangeLog | 10 ++++++++++ gcc/ada/exp_ch6.adb | 5 +++++ gcc/ada/s-os_lib.ads | 14 ++++++-------- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b19076c7361..1da9491fcb4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2015-10-26 Javier Miranda + + * exp_ch6.adb (Expand_N_Subprogram_Declaration): Skip the frontend + transformation of functions that return a constrained array into + a procedure when they are unchecked_conversion instances. + +2015-10-26 Gary Dismukes + + * s-os_lib.ads: Minor reformatting/rewording. + 2015-10-26 Arnaud Charlet * debug.adb: Introduce debug flag -gnatd.5. diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index a666ab22b85..b8488584290 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -5666,10 +5666,15 @@ package body Exp_Ch6 is -- constrained array type into a procedure with an out parameter -- that carries the return value. + -- We skip this transformation for unchecked conversions, since they + -- are not needed by the C generator (and this also produces cleaner + -- output). + if Modify_Tree_For_C and then Nkind (Specification (N)) = N_Function_Specification and then Is_Array_Type (Etype (Subp)) and then Is_Constrained (Etype (Subp)) + and then not Is_Unchecked_Conversion_Instance (Subp) then Build_Procedure_Form; end if; diff --git a/gcc/ada/s-os_lib.ads b/gcc/ada/s-os_lib.ads index e9bb9bf65b9..4c03c700f5a 100644 --- a/gcc/ada/s-os_lib.ads +++ b/gcc/ada/s-os_lib.ads @@ -877,14 +877,12 @@ package System.OS_Lib is -- there is no notion of executables under this OS. procedure Kill (Pid : Process_Id; Hard_Kill : Boolean := True); - -- Kill process known as Pid by the OS. Does nothing if Pid is - -- Invalid_Pid or on platforms where it is not supported like - -- VxWorks. - -- Hard_Kill is True by default and in this case the process - -- is terminated immediately. If Hard_Kill is False a signal - -- SIGINT is sent to the process on POSIX OS or a CTRL-C event - -- on Windows, this let the process a chance to quit properly - -- using a corresponding handler. + -- Kill the process designated by Pid. Does nothing if Pid is Invalid_Pid + -- or on platforms where it is not supported, such as VxWorks. Hard_Kill + -- is True by default, and when True the process is terminated immediately. + -- If Hard_Kill is False, then a signal SIGINT is sent to the process on + -- POSIX OS or a ctrl-C event on Windows, allowing the process a chance to + -- terminate properly using a corresponding handler. function Argument_String_To_List (Arg_String : String) return Argument_List_Access; -- 2.30.2