From: Piotr Trojanek Date: Fri, 15 May 2020 18:40:03 +0000 (+0200) Subject: [Ada] Style cleanups related to Current_Condition X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e3342889e86d70c670f833351f1eb9ad19eeb4e;p=gcc.git [Ada] Style cleanups related to Current_Condition gcc/ada/ * einfo.ads (Current_Value): Fix typo in comment. * exp_ch2.adb (Expand_Current_Value): Remove unnecessary "Start of processing ..." comment. * exp_util.adb (Set_Entity_Current_Value): Fix unbalanced paren in comment. (Get_Current_Value_Condition): Fix layout in comment. * sem_ch5.adb (Analyze_Cond_Then): Replace commented condition with pragma Assert. --- diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 7138b9d59de..7bb1f16d98d 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -822,7 +822,7 @@ package Einfo is -- Defined in all object entities. Set in E_Variable, E_Constant, formal -- parameters and E_Loop_Parameter entities if we have trackable current -- values. Set non-Empty if the (constant) current value of the variable --- is known, This value is valid only for references from the same +-- is known. This value is valid only for references from the same -- sequential scope as the entity. The sequential scope of an entity -- includes the immediate scope and any contained scopes that are package -- specs, package bodies, blocks (at any nesting level) or statement diff --git a/gcc/ada/exp_ch2.adb b/gcc/ada/exp_ch2.adb index b8ac2cde264..407ffcb434c 100644 --- a/gcc/ada/exp_ch2.adb +++ b/gcc/ada/exp_ch2.adb @@ -122,8 +122,6 @@ package body Exp_Ch2 is Val : Node_Id; Op : Node_Kind; - -- Start of processing for Expand_Current_Value - begin if True diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index d93788b8e5b..236d9ce6158 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -6418,7 +6418,7 @@ package body Exp_Util is if Loc < Sloc (CV) then return; - -- After end of IF statement + -- After end of IF statement elsif Loc >= Sloc (CV) + Text_Ptr (UI_To_Int (End_Span (CV))) then return; @@ -12741,7 +12741,7 @@ package body Exp_Util is -- they occur at the same level. If the second one is nested, -- then the decision is neither right nor wrong (it would be -- equally OK to leave the outer one in place, or take the new - -- inner one. Really we should record both, but our data + -- inner one). Really we should record both, but our data -- structures are not that elaborate. if Nkind (Current_Value (Ent)) not in N_Subexpr then diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 4028d0232ab..4664df83aba 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -1833,7 +1833,7 @@ package body Sem_Ch5 is -- If condition is False, analyze THEN with expansion off - else -- Is_False (Expr_Value (Cond)) + else pragma Assert (Is_False (Expr_Value (Cond))); Expander_Mode_Save_And_Set (False); In_Deleted_Code := True; Analyze_Statements (Tstm);