diff options
author | Yannick Moy <moy@adacore.com> | 2023-11-15 09:34:35 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-11-30 11:12:48 +0100 |
commit | e5eb84aa8ceebfa42c4fc02876f4902b461f87f3 (patch) | |
tree | d49cbe54693d648b58555e89142391d3a19a3847 /gcc/ada | |
parent | 44eddd691e54c4128904b7ea35bc05f8e3741877 (diff) | |
download | gcc-e5eb84aa8ceebfa42c4fc02876f4902b461f87f3.zip gcc-e5eb84aa8ceebfa42c4fc02876f4902b461f87f3.tar.gz gcc-e5eb84aa8ceebfa42c4fc02876f4902b461f87f3.tar.bz2 |
ada: Fix spelling of functions with(out) "side effects"
Correct spelling does not include an hyphen. Fix comments and one
error message.
Also fix other mispellings of "side-effect" or "side effect" depending
on the case (adjective should have hyphen), and "side-effect-free" with
double hyphen as an adjective.
gcc/ada/
* checks.adb, exp_aggr.adb, exp_ch4.ads, exp_ch5.adb,
exp_util.adb, exp_util.ads, inline.adb, sem_ch13.adb,
sem_ch6.adb, sem_ch8.adb, sem_prag.adb, sem_util.ads: Fix comments
and typos.
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/checks.adb | 2 | ||||
-rw-r--r-- | gcc/ada/exp_aggr.adb | 2 | ||||
-rw-r--r-- | gcc/ada/exp_ch4.ads | 2 | ||||
-rw-r--r-- | gcc/ada/exp_ch5.adb | 4 | ||||
-rw-r--r-- | gcc/ada/exp_util.adb | 86 | ||||
-rw-r--r-- | gcc/ada/exp_util.ads | 6 | ||||
-rw-r--r-- | gcc/ada/inline.adb | 2 | ||||
-rw-r--r-- | gcc/ada/sem_ch13.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_ch6.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_ch8.adb | 2 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 12 | ||||
-rw-r--r-- | gcc/ada/sem_util.ads | 2 |
12 files changed, 64 insertions, 64 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 84a21b2..14e82f2 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -1664,7 +1664,7 @@ package body Checks is end if; -- If the expressions for the discriminants are identical - -- and it is side-effect free (for now just an entity), + -- and it is side-effect-free (for now just an entity), -- this may be a shared constraint, e.g. from a subtype -- without a constraint introduced as a generic actual. -- Examine other discriminants if any. diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 513fc2d..2d02bad 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -1936,7 +1936,7 @@ package body Exp_Aggr is Aggr_Low : constant Node_Id := Duplicate_Subexpr_No_Checks (Aggr_L); Aggr_High : constant Node_Id := Duplicate_Subexpr_No_Checks (Aggr_H); - -- After Duplicate_Subexpr these are side-effect free + -- After Duplicate_Subexpr these are side-effect-free Assoc : Node_Id; Choice : Node_Id; diff --git a/gcc/ada/exp_ch4.ads b/gcc/ada/exp_ch4.ads index 39177cd..e240380 100644 --- a/gcc/ada/exp_ch4.ads +++ b/gcc/ada/exp_ch4.ads @@ -97,7 +97,7 @@ package Exp_Ch4 is -- individually to yield the required Boolean result. Loc is the -- location for the generated nodes. Typ is the type of the record, and -- Lhs, Rhs are the record expressions to be compared, these - -- expressions need not be analyzed but have to be side-effect free. + -- expressions need not be analyzed but have to be side-effect-free. -- Nod provides the Sloc value for generated code. procedure Expand_Set_Membership (N : Node_Id); diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index d946f6d..bc61243 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -162,7 +162,7 @@ package body Exp_Ch5 is procedure Expand_Assign_With_Target_Names (N : Node_Id); -- (AI12-0125): N is an assignment statement whose RHS contains occurrences -- of @ that designate the value of the LHS of the assignment. If the LHS - -- is side-effect free the target names can be replaced with a copy of the + -- is side-effect-free the target names can be replaced with a copy of the -- LHS; otherwise the semantics of the assignment is described in terms of -- a procedure with an in-out parameter, and expanded as such. @@ -2304,7 +2304,7 @@ package body Exp_Ch5 is Name => Relocate_Node (LHS), Expression => New_RHS)); - -- The left-hand side is not a direct name, but is side-effect free. + -- The left-hand side is not a direct name, but is side-effect-free. -- Capture its value in a temporary to avoid generating a procedure. -- We don't do this optimization if the target object's type may need -- finalization actions, because we don't want extra finalizations to diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 3dc34fc..17fde44 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -237,7 +237,7 @@ package body Exp_Util is function Side_Effect_Free_Attribute (Name : Name_Id) return Boolean; -- Return True if the evaluation of the given attribute is considered - -- side-effect free, independently of its prefix and expressions. + -- side-effect-free, independently of its prefix and expressions. ------------------------------------- -- Activate_Atomic_Synchronization -- @@ -9356,7 +9356,7 @@ package body Exp_Util is begin -- Build-in-place calls usually appear in 'reference format. Note that -- the accessibility check machinery may add an extra 'reference due to - -- side effect removal. + -- side-effect removal. while Nkind (Call) = N_Reference loop Call := Prefix (Call); @@ -12062,7 +12062,7 @@ package body Exp_Util is then return; - -- No action needed for side-effect free expressions + -- No action needed for side-effect-free expressions elsif Check_Side_Effects and then Side_Effect_Free (Exp, Name_Req, Variable_Ref) @@ -12087,15 +12087,15 @@ package body Exp_Util is Scope_Suppress.Suppress := (others => True); - -- If this is a side-effect free attribute reference whose expressions - -- are also side-effect free and whose prefix is not a name, remove the + -- If this is a side-effect-free attribute reference whose expressions + -- are also side-effect-free and whose prefix is not a name, remove the -- side effects of the prefix. A copy of the prefix is required in this -- case and it is better not to make an additional one for the attribute -- itself, because the return type of many of them is universal integer, -- which is a very large type for a temporary. -- The prefix of an attribute reference Reduce may be syntactically an -- aggregate, but will be expanded into a loop, so no need to remove - -- side-effects. + -- side effects. if Nkind (Exp) = N_Attribute_Reference and then Side_Effect_Free_Attribute (Attribute_Name (Exp)) @@ -12329,7 +12329,7 @@ package body Exp_Util is -- Otherwise we generate a reference to the expression else - -- When generating C code we cannot consider side effect free object + -- When generating C code we cannot consider side-effect-free object -- declarations that have discriminants and are initialized by means -- of a function call since on this target there is no secondary -- stack to store the return value and the expander may generate an @@ -13681,12 +13681,12 @@ package body Exp_Util is function Safe_Prefixed_Reference (N : Node_Id) return Boolean; -- The argument N is a construct where the Prefix is dereferenced if it -- is an access type and the result is a variable. The call returns True - -- if the construct is side effect free (not considering side effects in + -- if the construct is side-effect-free (not considering side effects in -- other than the prefix which are to be tested by the caller). function Within_In_Parameter (N : Node_Id) return Boolean; -- Determines if N is a subcomponent of a composite in-parameter. If so, - -- N is not side-effect free when the actual is global and modifiable + -- N is not side-effect-free when the actual is global and modifiable -- indirectly from within a subprogram, because it may be passed by -- reference. The front-end must be conservative here and assume that -- this may happen with any array or record type. On the other hand, we @@ -13703,7 +13703,7 @@ package body Exp_Util is function Safe_Prefixed_Reference (N : Node_Id) return Boolean is begin - -- If prefix is not side effect free, definitely not safe + -- If prefix is not side-effect-free, definitely not safe if not Side_Effect_Free (Prefix (N), Name_Req, Variable_Ref) then return False; @@ -13805,7 +13805,7 @@ package body Exp_Util is then return False; - -- All other cases are side effect free + -- All other cases are side-effect-free else return True; @@ -13846,7 +13846,7 @@ package body Exp_Util is -- However, we would prefer to consider that they are side effects, -- since the back end CSE does not work very well on expressions which -- can raise Constraint_Error. On the other hand if we don't consider - -- them to be side effect free, then we get some awkward expansions + -- them to be side-effect-free, then we get some awkward expansions -- in -gnato mode, resulting in code insertions at a point where we -- do not have a clear model for performing the insertions. @@ -13854,7 +13854,7 @@ package body Exp_Util is if Is_Entity_Name (N) then - -- A type reference is always side effect free + -- A type reference is always side-effect-free if Is_Type (Entity (N)) then return True; @@ -13875,12 +13875,12 @@ package body Exp_Util is return True; end if; - -- A value known at compile time is always side effect free + -- A value known at compile time is always side-effect-free elsif Compile_Time_Known_Value (N) then return True; - -- A variable renaming is not side-effect free, because the renaming + -- A variable renaming is not side-effect-free, because the renaming -- will function like a macro in the front-end in some cases, and an -- assignment can modify the component designated by N, so we need to -- create a temporary for it. @@ -13914,7 +13914,7 @@ package body Exp_Util is return Safe_Prefixed_Reference (RO); -- In all other cases, designated object cannot be changed so - -- we are side effect free. + -- we are side-effect-free. else return True; @@ -13954,8 +13954,8 @@ package body Exp_Util is case Nkind (N) is - -- An attribute reference is side-effect free if its expressions - -- are side-effect free and its prefix is side-effect free or is + -- An attribute reference is side-effect-free if its expressions + -- are side-effect-free and its prefix is side-effect-free or is -- an entity reference. when N_Attribute_Reference => @@ -13967,8 +13967,8 @@ package body Exp_Util is or else Side_Effect_Free (Prefix (N), Name_Req, Variable_Ref)); - -- A binary operator is side effect free if and both operands are - -- side effect free. For this purpose binary operators include + -- A binary operator is side-effect-free if and both operands are + -- side-effect-free. For this purpose binary operators include -- short circuit forms. when N_Binary_Op @@ -13989,14 +13989,14 @@ package body Exp_Util is else Side_Effect_Free (Alternatives (N), Name_Req, Variable_Ref)); - -- An explicit dereference is side effect free only if it is - -- a side effect free prefixed reference. + -- An explicit dereference is side-effect-free only if it is + -- a side-effect-free prefixed reference. when N_Explicit_Dereference => return Safe_Prefixed_Reference (N); - -- An expression with action is side effect free if its expression - -- is side effect free and it has no actions. + -- An expression with action is side-effect-free if its expression + -- is side-effect-free and it has no actions. when N_Expression_With_Actions => return @@ -14004,14 +14004,14 @@ package body Exp_Util is and then Side_Effect_Free (Expression (N), Name_Req, Variable_Ref); - -- A call to _rep_to_pos is side effect free, since we generate + -- A call to _rep_to_pos is side-effect-free, since we generate -- this pure function call ourselves. Moreover it is critically -- important to make this exception, since otherwise we can have - -- discriminants in array components which don't look side effect + -- discriminants in array components which don't look side-effect -- free in the case of an array whose index type is an enumeration -- type with an enumeration rep clause. - -- All other function calls are not side effect free + -- All other function calls are not side-effect-free when N_Function_Call => return @@ -14021,8 +14021,8 @@ package body Exp_Util is (First (Parameter_Associations (N)), Name_Req, Variable_Ref); - -- An IF expression is side effect free if it's of a scalar type, and - -- all its components are all side effect free (conditions and then + -- An IF expression is side-effect-free if it's of a scalar type, and + -- all its components are all side-effect-free (conditions and then -- actions and else actions). We restrict to scalar types, since it -- is annoying to deal with things like (if A then B else C)'First -- where the type involved is a string type. @@ -14033,9 +14033,9 @@ package body Exp_Util is and then Side_Effect_Free (Expressions (N), Name_Req, Variable_Ref); - -- An indexed component is side effect free if it is a side + -- An indexed component is side-effect-free if it is a side -- effect free prefixed reference and all the indexing - -- expressions are side effect free. + -- expressions are side-effect-free. when N_Indexed_Component => return @@ -14043,7 +14043,7 @@ package body Exp_Util is and then Safe_Prefixed_Reference (N); -- A type qualification, type conversion, or unchecked expression is - -- side effect free if the expression is side effect free. + -- side-effect-free if the expression is side-effect-free. when N_Qualified_Expression | N_Type_Conversion @@ -14051,35 +14051,35 @@ package body Exp_Util is => return Side_Effect_Free (Expression (N), Name_Req, Variable_Ref); - -- A selected component is side effect free only if it is a side + -- A selected component is side-effect-free only if it is a side -- effect free prefixed reference. when N_Selected_Component => return Safe_Prefixed_Reference (N); - -- A range is side effect free if the bounds are side effect free + -- A range is side-effect-free if the bounds are side-effect-free when N_Range => return Side_Effect_Free (Low_Bound (N), Name_Req, Variable_Ref) and then Side_Effect_Free (High_Bound (N), Name_Req, Variable_Ref); - -- A slice is side effect free if it is a side effect free - -- prefixed reference and the bounds are side effect free. + -- A slice is side-effect-free if it is a side-effect-free + -- prefixed reference and the bounds are side-effect-free. when N_Slice => return Side_Effect_Free (Discrete_Range (N), Name_Req, Variable_Ref) and then Safe_Prefixed_Reference (N); - -- A unary operator is side effect free if the operand - -- is side effect free. + -- A unary operator is side-effect-free if the operand + -- is side-effect-free. when N_Unary_Op => return Side_Effect_Free (Right_Opnd (N), Name_Req, Variable_Ref); - -- An unchecked type conversion is side effect free only if it - -- is safe and its argument is side effect free. + -- An unchecked type conversion is side-effect-free only if it + -- is safe and its argument is side-effect-free. when N_Unchecked_Type_Conversion => return @@ -14087,7 +14087,7 @@ package body Exp_Util is and then Side_Effect_Free (Expression (N), Name_Req, Variable_Ref); - -- A literal is side effect free + -- A literal is side-effect-free when N_Character_Literal | N_Integer_Literal @@ -14096,7 +14096,7 @@ package body Exp_Util is => return True; - -- An aggregate is side effect free if all its values are compile + -- An aggregate is side-effect-free if all its values are compile -- time known. when N_Aggregate => @@ -14112,7 +14112,7 @@ package body Exp_Util is end case; end Side_Effect_Free; - -- A list is side effect free if all elements of the list are side + -- A list is side-effect-free if all elements of the list are side -- effect free. function Side_Effect_Free diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index eb737d6..267a127 100644 --- a/gcc/ada/exp_util.ads +++ b/gcc/ada/exp_util.ads @@ -669,7 +669,7 @@ package Exp_Util is -- of the same expression won't generate multiple side effects, whereas -- Force_Evaluation further guarantees that all evaluations will yield -- the same result. If Mode is Relaxed then calls to this subprogram have - -- no effect if Exp is side-effect free; if Mode is Strict and Exp is not + -- no effect if Exp is side-effect-free; if Mode is Strict and Exp is not -- a static expression then no side-effect check is performed on Exp and -- temporaries are unconditionally generated. -- @@ -1075,7 +1075,7 @@ package Exp_Util is -- side effect (used in implementing Force_Evaluation). Note: after call to -- Remove_Side_Effects, it is safe to call New_Copy_Tree to obtain a copy -- of the resulting expression. If Check_Side_Effects is set to True then - -- no action is performed if Exp is known to be side-effect free. + -- no action is performed if Exp is known to be side-effect-free. -- -- Related_Id denotes the entity of the context where Expr appears. Flags -- Is_Low_Bound and Is_High_Bound specify whether the expression to check @@ -1206,7 +1206,7 @@ package Exp_Util is (L : List_Id; Name_Req : Boolean := False; Variable_Ref : Boolean := False) return Boolean; - -- Determines if all elements of the list L are side-effect free. Name_Req + -- Determines if all elements of the list L are side-effect-free. Name_Req -- and Variable_Ref are as described above. procedure Silly_Boolean_Array_Not_Test (N : Node_Id; T : Entity_Id); diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 1fbbe6d..cc2bc3a 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -3726,7 +3726,7 @@ package body Inline is Insert_After (Parent (Entity (N)), Blk); -- If the context is an assignment, and the left-hand side is free of - -- side-effects, the replacement is also safe. + -- side effects, the replacement is also safe. elsif Nkind (Parent (N)) = N_Assignment_Statement and then diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 302fab7..8f6fa3a 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -10794,7 +10794,7 @@ package body Sem_Ch13 is Set_Analyzed (FBody); end if; - -- Static predicate functions are always side-effect free, and + -- Static predicate functions are always side-effect-free, and -- in most cases dynamic predicate functions are as well. Mark -- them as such whenever possible, so redundant predicate checks -- can be optimized. If there is a variable reference within the @@ -16141,7 +16141,7 @@ package body Sem_Ch13 is function Extract_Entity (Expr : Node_Id) return Entity_Id; -- Given an element of a Stable_Properties aspect spec, return the -- associated entity. - -- This function updates the Negated flag as a side-effect. + -- This function updates the Negated flag as a side effect. -------------------- -- Extract_Entity -- diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 4f2521a..8ee7578 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -4612,7 +4612,7 @@ package body Sem_Ch6 is Analyze_SPARK_Subprogram_Specification (Specification (N)); - -- A function with side-effects shall not be an expression function + -- A function with side effects shall not be an expression function -- (SPARK RM 6.1.11(6)). if Present (Spec_Id) @@ -5240,7 +5240,7 @@ package body Sem_Ch6 is Analyze_Aspect_Specifications (N, Designator); -- The legality of a function specification in SPARK depends on whether - -- the function is a function with or without side-effects. Analyze the + -- the function is a function with or without side effects. Analyze the -- pragma in advance if present, before specific SPARK legality checks. Analyze_Pragmas_If_Present (N, Pragma_SPARK_Mode); diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index d231910..c5bf086 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -2691,7 +2691,7 @@ package body Sem_Ch8 is -- Each attempt to find a suitable primitive of a particular -- type operates on its own copy of the original renaming. -- As a result the original renaming is kept decoration and - -- side-effect free. + -- side-effect-free. -- Inherit the overloaded status of the renamed subprogram name diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index c49cb27..02f6f29 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -13425,7 +13425,7 @@ package body Sem_Prag is Analyze_If_Present (Pragma_Side_Effects); -- Pragma Always_Terminates is not allowed on functions without - -- side-effects. + -- side effects. if Ekind (Spec_Id) in E_Function | E_Generic_Function and then not Is_Function_With_Side_Effects (Spec_Id) @@ -16989,7 +16989,7 @@ package body Sem_Prag is Analyze_If_Present (Pragma_Side_Effects); -- Pragma Exceptional_Cases is not allowed on functions without - -- side-effects. + -- side effects. if Ekind (Spec_Id) in E_Function | E_Generic_Function and then not Is_Function_With_Side_Effects (Spec_Id) @@ -23072,7 +23072,7 @@ package body Sem_Prag is Analyze_If_Present (Pragma_Side_Effects); - -- A function with side-effects shall not have a Pure_Function + -- A function with side effects shall not have a Pure_Function -- aspect or pragma (SPARK RM 6.1.11(5)). if Is_Function_With_Side_Effects (E) then @@ -23949,8 +23949,8 @@ package body Sem_Prag is Add_Contract_Item (N, Spec_Id); - -- A function with side-effects cannot override a function without - -- side-effects (SPARK RM 7.1.2(16)). Overriding checks are + -- A function with side effects cannot override a function without + -- side effects (SPARK RM 7.1.2(16)). Overriding checks are -- usually performed in New_Overloaded_Entity, however at -- that point the pragma has not been processed yet. @@ -23960,7 +23960,7 @@ package body Sem_Prag is and then not Is_Function_With_Side_Effects (Over_Id) then Error_Msg_N - ("incompatible declaration of side-effects for function", + ("incompatible declaration of side effects for function", Spec_Id); Error_Msg_Sloc := Sloc (Over_Id); diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 96b4730..2fae35b 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -1480,7 +1480,7 @@ package Sem_Util is -- Is the given expression a container aggregate? function Is_Function_With_Side_Effects (Subp : Entity_Id) return Boolean; - -- Return True if Subp is a function with side-effects, ie. it has a + -- Return True if Subp is a function with side effects, ie. it has a -- (direct or inherited) pragma Side_Effects with static value True. function Is_Newly_Constructed |