[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.
This commit is contained in:
Piotr Trojanek 2020-05-15 20:40:03 +02:00 committed by Pierre-Marie de Rodat
parent 964a8141e1
commit 8e3342889e
4 changed files with 4 additions and 6 deletions

View File

@ -822,7 +822,7 @@ package Einfo is
-- Defined in all object entities. Set in E_Variable, E_Constant, formal -- Defined in all object entities. Set in E_Variable, E_Constant, formal
-- parameters and E_Loop_Parameter entities if we have trackable current -- parameters and E_Loop_Parameter entities if we have trackable current
-- values. Set non-Empty if the (constant) current value of the variable -- 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 -- sequential scope as the entity. The sequential scope of an entity
-- includes the immediate scope and any contained scopes that are package -- includes the immediate scope and any contained scopes that are package
-- specs, package bodies, blocks (at any nesting level) or statement -- specs, package bodies, blocks (at any nesting level) or statement

View File

@ -122,8 +122,6 @@ package body Exp_Ch2 is
Val : Node_Id; Val : Node_Id;
Op : Node_Kind; Op : Node_Kind;
-- Start of processing for Expand_Current_Value
begin begin
if True if True

View File

@ -6418,7 +6418,7 @@ package body Exp_Util is
if Loc < Sloc (CV) then if Loc < Sloc (CV) then
return; return;
-- After end of IF statement -- After end of IF statement
elsif Loc >= Sloc (CV) + Text_Ptr (UI_To_Int (End_Span (CV))) then elsif Loc >= Sloc (CV) + Text_Ptr (UI_To_Int (End_Span (CV))) then
return; return;
@ -12741,7 +12741,7 @@ package body Exp_Util is
-- they occur at the same level. If the second one is nested, -- they occur at the same level. If the second one is nested,
-- then the decision is neither right nor wrong (it would be -- then the decision is neither right nor wrong (it would be
-- equally OK to leave the outer one in place, or take the new -- 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. -- structures are not that elaborate.
if Nkind (Current_Value (Ent)) not in N_Subexpr then if Nkind (Current_Value (Ent)) not in N_Subexpr then

View File

@ -1833,7 +1833,7 @@ package body Sem_Ch5 is
-- If condition is False, analyze THEN with expansion off -- 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); Expander_Mode_Save_And_Set (False);
In_Deleted_Code := True; In_Deleted_Code := True;
Analyze_Statements (Tstm); Analyze_Statements (Tstm);