From: Robert Dewar Date: Thu, 13 Dec 2007 10:37:34 +0000 (+0100) Subject: treepr.ads, treepr.adb: (pl): implement use of positive value shorthands X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b998381423870a80e7479c7bdd4cf3ed48324a5;p=platform%2Fupstream%2Fgcc.git 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 --- diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb index fef8528..972e9a3 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 79dceb8..3d05748 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);