aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/treepr.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/treepr.adb')
-rw-r--r--gcc/ada/treepr.adb64
1 files changed, 61 insertions, 3 deletions
diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb
index b1a2c34..d58f3ce 100644
--- a/gcc/ada/treepr.adb
+++ b/gcc/ada/treepr.adb
@@ -87,7 +87,7 @@ package body Treepr is
procedure Destroy (Value : in out Nat) is null;
pragma Annotate (CodePeer, False_Positive, "unassigned parameter",
"in out parameter is required to instantiate generic");
- -- Dummy routine for destroing hashed values
+ -- Dummy routine for destroying hashed values
package Serial_Numbers is new Dynamic_Hash_Tables
(Key_Type => Int,
@@ -412,6 +412,34 @@ package body Treepr is
procedure pe (N : Union_Id) renames pn;
+ ---------
+ -- pec --
+ ---------
+
+ procedure pec (From : Entity_Id) is
+ begin
+ Push_Output;
+ Set_Standard_Output;
+
+ Print_Entity_Chain (From);
+
+ Pop_Output;
+ end pec;
+
+ ----------
+ -- rpec --
+ ----------
+
+ procedure rpec (From : Entity_Id) is
+ begin
+ Push_Output;
+ Set_Standard_Output;
+
+ Print_Entity_Chain (From, Rev => True);
+
+ Pop_Output;
+ end rpec;
+
--------
-- pl --
--------
@@ -589,6 +617,36 @@ package body Treepr is
end if;
end Print_End_Span;
+ ------------------------
+ -- Print_Entity_Chain --
+ ------------------------
+
+ procedure Print_Entity_Chain (From : Entity_Id; Rev : Boolean := False) is
+ Ent : Entity_Id := From;
+ begin
+ Printing_Descendants := False;
+ Phase := Printing;
+
+ loop
+ declare
+ Next_Ent : constant Entity_Id :=
+ (if Rev then Prev_Entity (Ent) else Next_Entity (Ent));
+
+ Prefix_Char : constant Character :=
+ (if Present (Next_Ent) then '|' else ' ');
+ begin
+ Print_Node (Ent, "", Prefix_Char);
+
+ exit when No (Next_Ent);
+
+ Ent := Next_Ent;
+
+ Print_Char ('|');
+ Print_Eol;
+ end;
+ end loop;
+ end Print_Entity_Chain;
+
-----------------------
-- Print_Entity_Info --
-----------------------
@@ -1144,8 +1202,8 @@ package body Treepr is
end if;
if not Is_List_Member (N) then
- Print_Str (Prefix_Str);
- Print_Str (" Parent = ");
+ Print_Str (Prefix);
+ Print_Str ("Parent = ");
Print_Node_Ref (Parent (N));
Print_Eol;
end if;