aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/atree.ads
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2022-06-06 13:22:39 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2022-07-05 08:28:19 +0000
commitdba077902daf195da0e5bbac33a1f34bc6b20367 (patch)
tree89a38c8a2d3df5e67746b459d5c94405150d8f7b /gcc/ada/atree.ads
parent824211e18b96dc56d3a530b31aa16cded2c941eb (diff)
downloadgcc-dba077902daf195da0e5bbac33a1f34bc6b20367.zip
gcc-dba077902daf195da0e5bbac33a1f34bc6b20367.tar.gz
gcc-dba077902daf195da0e5bbac33a1f34bc6b20367.tar.bz2
[Ada] Misc cleanup related to finalization
This patch cleans up some code issues found while working on finalization, and adds some debugging aids. gcc/ada/ * exp_ch7.adb: Change two constants Is_Protected_Body and Is_Prot_Body to be Is_Protected_Subp_Body; these are not true for protected bodies, but for protected subprogram bodies. (Expand_Cleanup_Actions): No need to search for Activation_Chain_Entity; just use Activation_Chain_Entity. * sem_ch8.adb (Find_Direct_Name): Use Entyp constant. * atree.adb, atree.ads, atree.h, nlists.adb, nlists.ads (Parent): Provide nonoverloaded versions of Parent, so that they can be easily found in the debugger. * debug_a.adb, debug_a.ads: Clarify that we're talking about the -gnatda switch; switches are case sensitive. Print out the Chars field if appropriate, which makes it easier to find things in the output. (Debug_Output_Astring): Simplify. Also fix an off-by-one bug ("for I in Vbars'Length .." should have been "for I in Vbars'Length + 1 .."). Before, it was printing Debug_A_Depth + 1 '|' characters if Debug_A_Depth > Vbars'Length.
Diffstat (limited to 'gcc/ada/atree.ads')
-rw-r--r--gcc/ada/atree.ads12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads
index 9d01cfc..0c809f5 100644
--- a/gcc/ada/atree.ads
+++ b/gcc/ada/atree.ads
@@ -446,10 +446,15 @@ package Atree is
-- Tests given Id for equality with the Empty node. This allows notations
-- like "if No (Variant_Part)" as opposed to "if Variant_Part = Empty".
- function Parent (N : Node_Or_Entity_Id) return Node_Or_Entity_Id;
+ function Node_Parent (N : Node_Or_Entity_Id) return Node_Or_Entity_Id;
+ pragma Inline (Node_Parent);
+ function Parent (N : Node_Or_Entity_Id) return Node_Or_Entity_Id
+ renames Node_Parent;
pragma Inline (Parent);
-- Returns the parent of a node if the node is not a list member, or else
-- the parent of the list containing the node if the node is a list member.
+ -- Parent has the same name as the one in Nlists; Node_Parent can be used
+ -- more easily in the debugger.
function Paren_Count (N : Node_Id) return Nat;
pragma Inline (Paren_Count);
@@ -465,7 +470,10 @@ package Atree is
-- Note that this routine is used only in very peculiar cases. In normal
-- cases, the Original_Node link is set by calls to Rewrite.
- procedure Set_Parent (N : Node_Or_Entity_Id; Val : Node_Or_Entity_Id);
+ procedure Set_Node_Parent (N : Node_Or_Entity_Id; Val : Node_Or_Entity_Id);
+ pragma Inline (Set_Node_Parent);
+ procedure Set_Parent (N : Node_Or_Entity_Id; Val : Node_Or_Entity_Id)
+ renames Set_Node_Parent;
pragma Inline (Set_Parent);
procedure Set_Paren_Count (N : Node_Id; Val : Nat);