From 9b998381423870a80e7479c7bdd4cf3ed48324a5 Mon Sep 17 00:00:00 2001 From: Robert Dewar Date: Thu, 13 Dec 2007 11:37:34 +0100 Subject: [PATCH] treepr.ads, treepr.adb: (pl): implement use of positive value shorthands 2007-12-06 Robert Dewar * treepr.ads, treepr.adb: (pl): implement use of positive value shorthands From-SVN: r130869 --- gcc/ada/treepr.adb | 33 +++++++++++++++++++++++++++++++-- gcc/ada/treepr.ads | 11 ++++++----- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb index fef852817b76..972e9a3da569 100644 --- a/gcc/ada/treepr.adb +++ b/gcc/ada/treepr.adb @@ -223,9 +223,38 @@ package body Treepr is -- pl -- -------- - procedure pl (L : List_Id) is + procedure pl (L : Int) is + Lid : Int; + begin - Print_Tree_List (L); + if L < 0 then + Lid := L; + + -- This is the case where we transform e.g. +36 to -99999936 + + else + if L <= 9 then + Lid := -(99999990 + L); + elsif L <= 99 then + Lid := -(99999900 + L); + elsif L <= 999 then + Lid := -(99999000 + L); + elsif L <= 9999 then + Lid := -(99990000 + L); + elsif L <= 99999 then + Lid := -(99900000 + L); + elsif L <= 999999 then + Lid := -(99000000 + L); + elsif L <= 9999999 then + Lid := -(90000000 + L); + else + Lid := -L; + end if; + end if; + + -- Now output the list + + Print_Tree_List (List_Id (Lid)); end pl; -------- diff --git a/gcc/ada/treepr.ads b/gcc/ada/treepr.ads index 79dceb8ad064..3d05748fd78e 100644 --- a/gcc/ada/treepr.ads +++ b/gcc/ada/treepr.ads @@ -59,13 +59,14 @@ package Treepr is procedure pe (E : Elist_Id); pragma Export (Ada, pe); - -- Debugging procedure (to be called within gdb) - -- same as Print_Tree_Elist + -- Debugging procedure (to be called within gdb), same as Print_Tree_Elist - procedure pl (L : List_Id); + procedure pl (L : Int); pragma Export (Ada, pl); - -- Debugging procedure (to be called within gdb) - -- same as Print_Tree_List + -- Debugging procedure (to be called within gdb), same as Print_Tree_List, + -- except that you can use e.g. 66 instead of -99999966. In other words + -- for the positive case we fill out to 8 digits on the left and add a + -- minus sign. This just saves some typing in the debugger. procedure pn (N : Node_Id); pragma Export (Ada, pn); -- 2.47.2