From 7ab4d95af734d904c16bf4af815e8810546feff6 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 4 Aug 2011 10:59:17 +0200 Subject: [multiple changes] 2011-08-04 Tristan Gingold * s-taprop-vxworks.adb (Enter_Task): Use System.Float_Control.Reset instead of the locally imported procedure. * s-taprop-mingw.adb (Enter_Task): Ditto. * s-valrea.adb (Scan_Real): Ditto. * s-imgrea.adb (Set_Image_Real): Ditto. * s-flocon.ads: Make the package pure. 2011-08-04 Thomas Quinot * sinfo.ads, sinfo.adb (Debug_Statement, Set_Debug_Statement): Remove. * tbuild.ads, tbuild.adb (Make_Pragma): Adjust accordingly. * sinfo-cn.ads, sinfo-cn.adb (Change_Name_To_Procedure_Call_Statement): New subprogram, moved here from... * par.adb, par-ch5.adb (P_Statement_Name): ... here. * par-prag.adb (Par.Prag, case Pragma_Debug): Do not perform any rewriting of the last argument into a procedure call statement here... * sem_prag.adb (Analyze_Pragma, case Pragma_Debug): ...do it there instead. 2011-08-04 Thomas Quinot * par_sco.adb: Minor reformatting. From-SVN: r177337 --- gcc/ada/sinfo-cn.adb | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) (limited to 'gcc/ada/sinfo-cn.adb') diff --git a/gcc/ada/sinfo-cn.adb b/gcc/ada/sinfo-cn.adb index 2b4eaa2..69b4705 100644 --- a/gcc/ada/sinfo-cn.adb +++ b/gcc/ada/sinfo-cn.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -30,7 +30,8 @@ -- general manner, but in some specific cases, the fields of related nodes -- have been deliberately layed out in a manner that permits such alteration. -with Atree; use Atree; +with Atree; use Atree; +with Snames; use Snames; package body Sinfo.CN is @@ -74,6 +75,58 @@ package body Sinfo.CN is N := Extend_Node (N); end Change_Identifier_To_Defining_Identifier; + --------------------------------------------- + -- Change_Name_To_Procedure_Call_Statement -- + --------------------------------------------- + + procedure Change_Name_To_Procedure_Call_Statement (N : Node_Id) is + begin + -- Case of Indexed component, which is a procedure call with arguments + + if Nkind (N) = N_Indexed_Component then + declare + Prefix_Node : constant Node_Id := Prefix (N); + Exprs_Node : constant List_Id := Expressions (N); + + begin + Change_Node (N, N_Procedure_Call_Statement); + Set_Name (N, Prefix_Node); + Set_Parameter_Associations (N, Exprs_Node); + end; + + -- Case of function call node, which is a really a procedure call + + elsif Nkind (N) = N_Function_Call then + declare + Fname_Node : constant Node_Id := Name (N); + Params_List : constant List_Id := Parameter_Associations (N); + + begin + Change_Node (N, N_Procedure_Call_Statement); + Set_Name (N, Fname_Node); + Set_Parameter_Associations (N, Params_List); + end; + + -- Case of call to attribute that denotes a procedure. Here we just + -- leave the attribute reference unchanged. + + elsif Nkind (N) = N_Attribute_Reference + and then Is_Procedure_Attribute_Name (Attribute_Name (N)) + then + null; + + -- All other cases of names are parameterless procedure calls + + else + declare + Name_Node : constant Node_Id := Relocate_Node (N); + begin + Change_Node (N, N_Procedure_Call_Statement); + Set_Name (N, Name_Node); + end; + end if; + end Change_Name_To_Procedure_Call_Statement; + -------------------------------------------------------- -- Change_Operator_Symbol_To_Defining_Operator_Symbol -- -------------------------------------------------------- -- cgit v1.1