From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 10F5E3948A71; Thu, 17 Jun 2021 14:33:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10F5E3948A71 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1573] [Ada] Display Entity in debugging printouts X-Act-Checkin: gcc X-Git-Author: Bob Duff X-Git-Refname: refs/heads/master X-Git-Oldrev: 9e1ca4e3ab0fb7156fed4480c8f35810d00ff84d X-Git-Newrev: 8863c3aa86c4dffd1869c04c7df7b5065751235d Message-Id: <20210617143314.10F5E3948A71@sourceware.org> Date: Thu, 17 Jun 2021 14:33:14 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2021 14:33:14 -0000 https://gcc.gnu.org/g:8863c3aa86c4dffd1869c04c7df7b5065751235d commit r12-1573-g8863c3aa86c4dffd1869c04c7df7b5065751235d Author: Bob Duff Date: Thu Mar 4 16:27:05 2021 -0500 [Ada] Display Entity in debugging printouts gcc/ada/ * treepr.adb (Print_Node): Display the Entity or Associated_Node fields if appropriate. * sinfo-utils.ads (F_Associated_Node, F_Entity): Remove. These are no longer needed. Diff: --- gcc/ada/sinfo-utils.ads | 6 ------ gcc/ada/treepr.adb | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/gcc/ada/sinfo-utils.ads b/gcc/ada/sinfo-utils.ads index dce659232f4..ab8e52866dc 100644 --- a/gcc/ada/sinfo-utils.ads +++ b/gcc/ada/sinfo-utils.ads @@ -139,12 +139,6 @@ package Sinfo.Utils is (N : N_Inclusive_Has_Entity; Val : Node_Id) renames Set_Entity_Or_Associated_Node; - function F_Associated_Node return Node_Field renames - F_Entity_Or_Associated_Node; - function F_Entity return Node_Field renames - F_Entity_Or_Associated_Node; - -- Note that we are renaming the enumeration literals here - --------------- -- Debugging -- --------------- diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb index 50d4ca3ccbd..d869ea72987 100644 --- a/gcc/ada/treepr.adb +++ b/gcc/ada/treepr.adb @@ -1272,14 +1272,22 @@ package body Treepr is Print_Eol; end if; - -- Print Entity field if operator (other cases of Entity - -- are in the table, so are handled in the normal circuit) + -- Deal with Entity_Or_Associated_Node. If N has both, then just + -- print Entity; they are the same thing. - if Nkind (N) in N_Op and then Present (Entity (N)) then + if N in N_Inclusive_Has_Entity and then Present (Entity (N)) then Print_Str (Prefix); Print_Str ("Entity = "); Print_Node_Ref (Entity (N)); Print_Eol; + + elsif N in N_Has_Associated_Node + and then Present (Associated_Node (N)) + then + Print_Str (Prefix); + Print_Str ("Associated_Node = "); + Print_Node_Ref (Associated_Node (N)); + Print_Eol; end if; -- Print special fields if we have a subexpression @@ -1391,7 +1399,7 @@ package body Treepr is | F_Sloc | F_Left_Opnd | F_Right_Opnd - | F_Entity + | F_Entity_Or_Associated_Node -- one of them was printed | F_Assignment_OK | F_Do_Range_Check | F_Has_Dynamic_Length_Check