OSDN Git Service

2007-12-06 Robert Dewar <dewar@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 Dec 2007 10:37:34 +0000 (10:37 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 Dec 2007 10:37:34 +0000 (10:37 +0000)
* treepr.ads, treepr.adb: (pl): implement use of positive value
shorthands

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130869 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/treepr.adb
gcc/ada/treepr.ads

index fef8528..972e9a3 100644 (file)
@@ -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;
 
    --------
index 79dceb8..3d05748 100644 (file)
@@ -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);