From: Gary Dismukes Date: Sat, 8 May 2021 21:49:04 +0000 (-0400) Subject: [Ada] Removal of various ??? comments plus related code changes X-Git-Tag: basepoints/gcc-13~6250 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06a5fb60eb53ef297454f58db61d3374d538f515;p=thirdparty%2Fgcc.git [Ada] Removal of various ??? comments plus related code changes gcc/ada/ * checks.adb: Remove calls of Set_Do_Tag_Check (N, False). * einfo.ads: Remove hanging unneeded ??? comment ("this real description was clobbered"). * exp_util.ads (Insert_Actions_After): Remove ??? from spec comment. * gen_il-fields.ads (Opt_Field_Enum): Remove literals Do_Accessibility_Check and Do_Tag_Check. * gen_il-gen-gen_nodes.adb: Remove all calls to Sm for Do_Accessibility_Check and Do_Tag_Check. * sem_type.ads (Is_Subtype_Of): Remove obsolete ??? comment (function is not limited to scalar subtypes). * sem_util.ads (Is_Local_Variable_Reference): Revise comment to mention out-mode parameters as well, and remove ???. (Propagate_Concurrent_Flags): Minor reformatting. (Propagate_Invariant_Attributes): Typo fix. (Propagate_Predicate_Attributes): Indicate what is propagated and remove ??? comment. * sem_util.adb (Cannot_Raise_Constraint_Error): Remove unneeded test of Do_Tag_Check. (Is_Local_Variable_Reference): Extend function to testing for formals of mode out as well. * sinfo.ads: Remove ??? comment about flag Convert_To_Return_False indicating that the flag is obsolete (in fact it's used). Remove references to Do_Accessibility_Check and Do_Tag_Check (and the two associated ??? comments), as these flags are unneeded. * sinfo-cn.adb (Change_Conversion_To_Unchecked): Remove call of Set_Do_Tag_Check (N, False). * targparm.ads (Support_Atomic_Primitives_On_Target): Remove ??? comment, plus minor reformatting. --- diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 96a2a3f3df1d..d3d785249698 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -9766,9 +9766,6 @@ package body Checks is when N_Attribute_Reference => Set_Do_Overflow_Check (N, False); - when N_Function_Call => - Set_Do_Tag_Check (N, False); - when N_Op => Set_Do_Overflow_Check (N, False); @@ -9804,7 +9801,6 @@ package body Checks is when N_Type_Conversion => Set_Do_Length_Check (N, False); - Set_Do_Tag_Check (N, False); Set_Do_Overflow_Check (N, False); when others => diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 59588bb94d0a..2feef7a0bf76 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -1931,8 +1931,6 @@ package Einfo is -- that clients should generally not test this flag directly, but instead -- use function Has_Unreferenced. --- ??? this real description was clobbered - -- Has_Pragma_Unreferenced_Objects -- Defined in all entities. Set if a valid pragma Unused applies to an -- entity, indicating that warnings should be given if the entity is diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index 2b3147d89d3f..3be0166896a6 100644 --- a/gcc/ada/exp_util.ads +++ b/gcc/ada/exp_util.ads @@ -162,7 +162,7 @@ package Exp_Util is -- -- Implementation limitation: Assoc_Node must be a statement. We can -- generalize to expressions if there is a need but this is tricky to - -- implement because of short-circuits (among other things).??? + -- implement because of short-circuits (among other things). procedure Insert_Declaration (N : Node_Id; Decl : Node_Id); -- N must be a subexpression (Nkind in N_Subexpr). This is similar to diff --git a/gcc/ada/gen_il-fields.ads b/gcc/ada/gen_il-fields.ads index 603f08a7d9f9..e2592eedcc9d 100644 --- a/gcc/ada/gen_il-fields.ads +++ b/gcc/ada/gen_il-fields.ads @@ -150,14 +150,12 @@ package Gen_IL.Fields is Discrete_Subtype_Definitions, Discriminant_Specifications, Discriminant_Type, - Do_Accessibility_Check, Do_Discriminant_Check, Do_Division_Check, Do_Length_Check, Do_Overflow_Check, Do_Range_Check, Do_Storage_Check, - Do_Tag_Check, Elaborate_All_Desirable, Elaborate_All_Present, Elaborate_Desirable, diff --git a/gcc/ada/gen_il-gen-gen_nodes.adb b/gcc/ada/gen_il-gen-gen_nodes.adb index e6defb15aa9e..ef7dfa4c1908 100644 --- a/gcc/ada/gen_il-gen-gen_nodes.adb +++ b/gcc/ada/gen_il-gen-gen_nodes.adb @@ -390,7 +390,6 @@ begin -- Gen_IL.Gen.Gen_Nodes Ab (N_Subprogram_Call, N_Subexpr, (Sm (Controlling_Argument, Node_Id), - Sm (Do_Tag_Check, Flag), Sm (First_Named_Actual, Node_Id), Sm (Is_Elaboration_Checks_OK_Node, Flag), Sm (Is_Elaboration_Warnings_OK_Node, Flag), @@ -553,7 +552,6 @@ begin -- Gen_IL.Gen.Gen_Nodes Sm (Do_Discriminant_Check, Flag), Sm (Do_Length_Check, Flag), Sm (Do_Overflow_Check, Flag), - Sm (Do_Tag_Check, Flag), Sm (Float_Truncate, Flag), Sm (Rounded_Result, Flag))); @@ -949,7 +947,6 @@ begin -- Gen_IL.Gen.Gen_Nodes Sm (Componentwise_Assignment, Flag), Sm (Do_Discriminant_Check, Flag), Sm (Do_Length_Check, Flag), - Sm (Do_Tag_Check, Flag), Sm (Forwards_OK, Flag), Sm (Has_Target_Names, Flag), Sm (Is_Elaboration_Checks_OK_Node, Flag), @@ -1056,7 +1053,6 @@ begin -- Gen_IL.Gen.Gen_Nodes (Sy (Expression, Node_Id, Default_Empty), Sm (By_Ref, Flag), Sm (Comes_From_Extended_Return_Statement, Flag), - Sm (Do_Tag_Check, Flag), Sm (Procedure_To_Call, Node_Id), Sm (Return_Statement_Entity, Node_Id), Sm (Storage_Pool, Node_Id))); @@ -1065,7 +1061,6 @@ begin -- Gen_IL.Gen.Gen_Nodes (Sy (Return_Object_Declarations, List_Id), Sy (Handled_Statement_Sequence, Node_Id, Default_Empty), Sm (By_Ref, Flag), - Sm (Do_Tag_Check, Flag), Sm (Procedure_To_Call, Node_Id), Sm (Return_Statement_Entity, Node_Id), Sm (Storage_Pool, Node_Id))); @@ -1487,7 +1482,6 @@ begin -- Gen_IL.Gen.Gen_Nodes Sy (Parameter_Type, Node_Id), Sy (Expression, Node_Id, Default_Empty), Sm (Default_Expression, Node_Id), - Sm (Do_Accessibility_Check, Flag), Sm (More_Ids, Flag), Sm (Prev_Ids, Flag))); diff --git a/gcc/ada/sem_type.ads b/gcc/ada/sem_type.ads index 89fd617ad504..018c2837fd7e 100644 --- a/gcc/ada/sem_type.ads +++ b/gcc/ada/sem_type.ads @@ -243,8 +243,7 @@ package Sem_Type is -- in the signature of an inherited operation must carry the derived type. function Is_Subtype_Of (T1 : Entity_Id; T2 : Entity_Id) return Boolean; - -- Checks whether T1 is any subtype of T2 directly or indirectly. Applies - -- only to scalar subtypes??? + -- Checks whether T1 is any subtype of T2 directly or indirectly function Operator_Matches_Spec (Op, New_S : Entity_Id) return Boolean; -- Used to resolve subprograms renaming operators, and calls to user diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 5c6a70134af2..cfb3293c3d0b 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -3087,7 +3087,6 @@ package body Sem_Util is when N_Type_Conversion => if Do_Overflow_Check (Expr) or else Do_Length_Check (Expr) - or else Do_Tag_Check (Expr) then return False; else @@ -18097,7 +18096,9 @@ package body Sem_Util is Ent : constant Entity_Id := Entity (Expr); Sub : constant Entity_Id := Enclosing_Subprogram (Ent); begin - if Ekind (Ent) not in E_Variable | E_In_Out_Parameter then + if Ekind (Ent) + not in E_Variable | E_In_Out_Parameter | E_Out_Parameter + then return False; else return Present (Sub) and then Sub = Current_Subprogram; diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 7cacae2f9079..bacf8b424599 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -2113,9 +2113,8 @@ package Sem_Util is -- limited view must be treated in the same way. function Is_Local_Variable_Reference (Expr : Node_Id) return Boolean; - -- Determines whether Expr is a reference to a variable or IN OUT mode - -- parameter of the current enclosing subprogram. - -- Why are OUT parameters not considered here ??? + -- Determines whether Expr is a reference to a variable or formal parameter + -- of mode OUT or IN OUT of the current enclosing subprogram. function Is_Master (N : Node_Id) return Boolean; -- Determine if the given node N constitutes a finalization master @@ -2902,9 +2901,9 @@ package Sem_Util is procedure Propagate_Concurrent_Flags (Typ : Entity_Id; Comp_Typ : Entity_Id); - -- Set Has_Task, Has_Protected and Has_Timing_Event on Typ when the flags - -- are set on Comp_Typ. This follows the definition of these flags which - -- are set (recursively) on any composite type which has a component marked + -- Set Has_Task, Has_Protected, and Has_Timing_Event on Typ when the flags + -- are set on Comp_Typ. This follows the definition of these flags, which + -- are set (recursively) on any composite type that has a component marked -- by one of these flags. This procedure can only set flags for Typ, and -- never clear them. Comp_Typ is the type of a component or a parent. @@ -2917,14 +2916,14 @@ package Sem_Util is procedure Propagate_Invariant_Attributes (Typ : Entity_Id; From_Typ : Entity_Id); - -- Inherit all invariant-related attributes form type From_Typ. Typ is the + -- Inherit all invariant-related attributes from type From_Typ. Typ is the -- destination type. procedure Propagate_Predicate_Attributes (Typ : Entity_Id; From_Typ : Entity_Id); - -- Inherit some predicate-related attributes form type From_Typ. Typ is the - -- destination type. Probably to be completed with more attributes??? + -- Inherit predicate functions and Has_Predicates flag from type From_Typ. + -- Typ is the destination type. procedure Record_Possible_Part_Of_Reference (Var_Id : Entity_Id; diff --git a/gcc/ada/sinfo-cn.adb b/gcc/ada/sinfo-cn.adb index 9a9af9b08f69..c676d47527ee 100644 --- a/gcc/ada/sinfo-cn.adb +++ b/gcc/ada/sinfo-cn.adb @@ -56,7 +56,6 @@ package body Sinfo.CN is procedure Change_Conversion_To_Unchecked (N : Node_Id) is begin Set_Do_Overflow_Check (N, False); - Set_Do_Tag_Check (N, False); Set_Do_Length_Check (N, False); Mutate_Nkind (N, N_Unchecked_Type_Conversion); end Change_Conversion_To_Unchecked; diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index fe4f4e142b56..8f23f7dfe1a2 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -689,11 +689,9 @@ package Sinfo is -- The following flag fields appear in various nodes: - -- Do_Accessibility_Check -- Do_Discriminant_Check -- Do_Length_Check -- Do_Storage_Check - -- Do_Tag_Check -- These flags are used in some specific cases by the front end, either -- during semantic analysis or during expansion, and cannot be expected @@ -1012,7 +1010,7 @@ package Sinfo is -- Present in N_Raise_Expression nodes that appear in the body of the -- special predicateM function used to test a predicate in the context -- of a membership test, where raise expression results in returning a - -- value of False rather than raising an exception.???obsolete flag + -- value of False rather than raising an exception. -- Corresponding_Aspect -- Present in N_Pragma node. Used to point back to the source aspect from @@ -1096,11 +1094,6 @@ package Sinfo is -- discriminant checking functions are constructed. The purpose is to -- avoid attempting to set these functions more than once. - -- Do_Accessibility_Check - -- This flag is set on N_Parameter_Specification nodes to indicate - -- that an accessibility check is required for the parameter. It is - -- not yet decided who takes care of this check???. - -- Do_Discriminant_Check -- This flag is set on N_Selected_Component nodes to indicate that a -- discriminant check is required using the discriminant check routine @@ -1185,13 +1178,6 @@ package Sinfo is -- to the runtime routine. The N_Subprogram_Body case is handled by the -- backend, and all the semantics does is set the flag. - -- Do_Tag_Check - -- This flag is set on an N_Assignment_Statement, N_Function_Call, - -- N_Procedure_Call_Statement, N_Type_Conversion, - -- N_Simple_Return_Statement, or N_Extended_Return_Statement - -- node to indicate that the tag check can be suppressed. It is not - -- yet decided how this flag is used???. - -- Elaborate_Present -- This flag is set in the N_With_Clause node to indicate that pragma -- Elaborate pragma appears for the with'ed units. @@ -4740,7 +4726,6 @@ package Sinfo is -- Do_Discriminant_Check -- Do_Length_Check -- Float_Truncate - -- Do_Tag_Check -- Conversion_OK -- Do_Overflow_Check -- Rounded_Result @@ -4913,7 +4898,6 @@ package Sinfo is -- No_Ctrl_Actions -- Has_Target_Names -- Is_Elaboration_Code - -- Do_Tag_Check -- Componentwise_Assignment -- Suppress_Assignment_Checks @@ -5436,7 +5420,6 @@ package Sinfo is -- Null_Exclusion_Present -- Parameter_Type subtype mark or access definition -- Expression (set to Empty if no default expression present) - -- Do_Accessibility_Check -- More_Ids (set to False if no more identifiers in list) -- Prev_Ids (set to False if no previous identifiers in list) -- Default_Expression @@ -5505,7 +5488,6 @@ package Sinfo is -- Is_SPARK_Mode_On_Node -- Is_Elaboration_Warnings_OK_Node -- No_Elaboration_Check - -- Do_Tag_Check -- Is_Known_Guaranteed_ABE -- plus fields for expression @@ -5539,7 +5521,6 @@ package Sinfo is -- Is_Elaboration_Warnings_OK_Node -- No_Elaboration_Check -- Is_Expanded_Build_In_Place_Call - -- Do_Tag_Check -- No_Side_Effect_Removal -- Is_Known_Guaranteed_ABE -- plus fields for expression @@ -5602,7 +5583,6 @@ package Sinfo is -- Expression (set to Empty if no expression present) -- Storage_Pool -- Procedure_To_Call - -- Do_Tag_Check -- By_Ref -- Comes_From_Extended_Return_Statement @@ -5618,7 +5598,6 @@ package Sinfo is -- Handled_Statement_Sequence (set to Empty if not present) -- Storage_Pool -- Procedure_To_Call - -- Do_Tag_Check -- By_Ref -- Note: Return_Statement_Entity points to an E_Return_Statement. diff --git a/gcc/ada/targparm.ads b/gcc/ada/targparm.ads index 28465ea6c7e7..302247fbeac1 100644 --- a/gcc/ada/targparm.ads +++ b/gcc/ada/targparm.ads @@ -365,12 +365,12 @@ package Targparm is -- this flag is False, and the use of aggregates is not permitted. Support_Atomic_Primitives_On_Target : Boolean := False; - -- If this flag is True, then the back-end support GCC built-in atomic - -- operations for memory model such as atomic load or atomic compare + -- If this flag is True, then the back end supports GCC built-in atomic + -- operations for memory model, such as atomic load or atomic compare -- exchange (see the GCC manual for more information). If the flag is - -- False, then the back-end doesn't provide this support. Note this flag is - -- set to True only if the target supports all atomic primitives up to 64 - -- bits. ??? To be modified. + -- False, then the back end doesn't provide this support. Note that this + -- flag is set to True only if the target supports all atomic primitives + -- up to 64 bits. Support_Composite_Assign_On_Target : Boolean := True; -- The assignment of composite objects other than small records and