From: Robert Dewar Date: Fri, 22 May 2015 10:25:20 +0000 (+0000) Subject: atree.adb, atree.ads (Needs_Actuals_Check): New flag. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a02c5a694eab9da43296e18b0c669e731c31427a;p=gcc.git atree.adb, atree.ads (Needs_Actuals_Check): New flag. 2015-05-22 Robert Dewar * atree.adb, atree.ads (Needs_Actuals_Check): New flag. From-SVN: r223536 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a2dfb2879c8..7708e137afd 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2015-05-22 Robert Dewar + + * atree.adb, atree.ads (Needs_Actuals_Check): New flag. + 2015-05-22 Hristian Kirtchev * sem_prag.adb (Analyze_Pragma): Remove the detection diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb index 93750872997..457fa622d77 100644 --- a/gcc/ada/atree.adb +++ b/gcc/ada/atree.adb @@ -594,6 +594,10 @@ package body Atree is Set_Is_Ignored_Ghost_Node (New_Id); end if; + -- Clear Needs_Actual_Check to False + + Set_Needs_Actuals_Check (New_Id, False); + -- Specifically copy Paren_Count to deal with creating new table entry -- if the parentheses count is at the maximum possible value already. @@ -1489,6 +1493,15 @@ package body Atree is Nodes.Table (New_Node).Rewrite_Ins := True; end Mark_Rewrite_Insertion; + ------------------------- + -- Needs_Actuals_Check -- + ------------------------- + + function Needs_Actuals_Check (N : Node_Id) return Boolean is + begin + return Flags.Table (N).Needs_Actuals_Check; + end Needs_Actuals_Check; + -------------- -- New_Copy -- -------------- @@ -2097,6 +2110,15 @@ package body Atree is Flags.Table (N).Is_Ignored_Ghost_Node := Val; end Set_Is_Ignored_Ghost_Node; + ----------------------------- + -- Set_Needs_Actuals_Check -- + ----------------------------- + + procedure Set_Needs_Actuals_Check (N : Node_Id; Val : Boolean := True) is + begin + Flags.Table (N).Needs_Actuals_Check := Val; + end Set_Needs_Actuals_Check; + ----------------------- -- Set_Original_Node -- ----------------------- diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads index c1c330cdc63..c3f9c5c7b64 100644 --- a/gcc/ada/atree.ads +++ b/gcc/ada/atree.ads @@ -605,44 +605,46 @@ package Atree is -- The following functions return the contents of the indicated field of -- the node referenced by the argument, which is a Node_Id. - function Analyzed (N : Node_Id) return Boolean; + function Analyzed (N : Node_Id) return Boolean; pragma Inline (Analyzed); - function Comes_From_Source (N : Node_Id) return Boolean; + function Comes_From_Source (N : Node_Id) return Boolean; pragma Inline (Comes_From_Source); - function Error_Posted (N : Node_Id) return Boolean; + function Error_Posted (N : Node_Id) return Boolean; pragma Inline (Error_Posted); - function Has_Aspects (N : Node_Id) return Boolean; + function Has_Aspects (N : Node_Id) return Boolean; pragma Inline (Has_Aspects); - function Is_Ignored_Ghost_Node - (N : Node_Id) return Boolean; + function Is_Ignored_Ghost_Node (N : Node_Id) return Boolean; pragma Inline (Is_Ignored_Ghost_Node); - function Nkind (N : Node_Id) return Node_Kind; + function Needs_Actuals_Check (N : Node_Id) return Boolean; + pragma Inline (Needs_Actuals_Check); + + function Nkind (N : Node_Id) return Node_Kind; pragma Inline (Nkind); - function No (N : Node_Id) return Boolean; + function No (N : Node_Id) return Boolean; pragma Inline (No); -- 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_Id) return Node_Id; + function Parent (N : Node_Id) return Node_Id; 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. - function Paren_Count (N : Node_Id) return Nat; + function Paren_Count (N : Node_Id) return Nat; pragma Inline (Paren_Count); - function Present (N : Node_Id) return Boolean; + function Present (N : Node_Id) return Boolean; pragma Inline (Present); -- Tests given Id for inequality with the Empty node. This allows notations -- like "if Present (Statement)" as opposed to "if Statement /= Empty". - function Sloc (N : Node_Id) return Source_Ptr; + function Sloc (N : Node_Id) return Source_Ptr; pragma Inline (Sloc); --------------------- @@ -893,26 +895,29 @@ package Atree is -- to be set in the specified field. Note that Set_Nkind is in the next -- section, since its use is restricted. - procedure Set_Analyzed (N : Node_Id; Val : Boolean := True); + procedure Set_Analyzed (N : Node_Id; Val : Boolean := True); pragma Inline (Set_Analyzed); - procedure Set_Comes_From_Source (N : Node_Id; Val : Boolean); + procedure Set_Comes_From_Source (N : Node_Id; Val : Boolean); pragma Inline (Set_Comes_From_Source); -- Note that this routine is very rarely used, since usually the default -- mechanism provided sets the right value, but in some unusual cases, the -- value needs to be reset (e.g. when a source node is copied, and the copy -- must not have Comes_From_Source set). - procedure Set_Error_Posted (N : Node_Id; Val : Boolean := True); + procedure Set_Error_Posted (N : Node_Id; Val : Boolean := True); pragma Inline (Set_Error_Posted); - procedure Set_Has_Aspects (N : Node_Id; Val : Boolean := True); + procedure Set_Has_Aspects (N : Node_Id; Val : Boolean := True); pragma Inline (Set_Has_Aspects); procedure Set_Is_Ignored_Ghost_Node (N : Node_Id; Val : Boolean := True); pragma Inline (Set_Is_Ignored_Ghost_Node); - procedure Set_Original_Node (N : Node_Id; Val : Node_Id); + procedure Set_Needs_Actuals_Check (N : Node_Id; Val : Boolean := True); + pragma Inline (Set_Needs_Actuals_Check); + + procedure Set_Original_Node (N : Node_Id; Val : Node_Id); pragma Inline (Set_Original_Node); -- Note that this routine is used only in very peculiar cases. In normal -- cases, the Original_Node link is set by calls to Rewrite. We currently @@ -920,13 +925,13 @@ package Atree is -- their aspect original source expressions, so that the original source -- expressions accessed by ASIS are also semantically analyzed. - procedure Set_Parent (N : Node_Id; Val : Node_Id); + procedure Set_Parent (N : Node_Id; Val : Node_Id); pragma Inline (Set_Parent); - procedure Set_Paren_Count (N : Node_Id; Val : Nat); + procedure Set_Paren_Count (N : Node_Id; Val : Nat); pragma Inline (Set_Paren_Count); - procedure Set_Sloc (N : Node_Id; Val : Source_Ptr); + procedure Set_Sloc (N : Node_Id; Val : Source_Ptr); pragma Inline (Set_Sloc); ------------------------------ @@ -4123,16 +4128,25 @@ package Atree is type Flags_Byte is record Flag0 : Boolean; + -- Note: we don't use Flag0 at the moment. To put Flag0 into use + -- requires some awkward work in Treeprs (treeprs.adt), so for the + -- moment we don't use it. + Flag1 : Boolean; Flag2 : Boolean; Flag3 : Boolean; + -- These flags are used in the usual manner in Sinfo and Einfo Is_Ignored_Ghost_Node : Boolean; -- Flag denothing whether the node is subject to pragma Ghost with -- policy Ignore. The name of the flag should be Flag4, however this -- requires changing the names of all remaining 300+ flags. - Spare1 : Boolean; + Needs_Actuals_Check : Boolean; + -- Flag set to indicate that the marked node is subject to the check + -- for writable actuals. See xxx for more details. Again it would be + -- more uniform to use some Flagx here, but that would be disruptive. + Spare2 : Boolean; Spare3 : Boolean; end record;