else
declare
- A_Idx : Node_Id := Empty;
+ A_Idx : Node_Id;
A_Range : Node_Id;
- Ind : Nat;
+ Ind : Pos;
Num : List_Id;
Range_N : Node_Id;
if Nkind (A_Idx) = N_Range then
A_Range := A_Idx;
- elsif Nkind (A_Idx) = N_Identifier
- or else Nkind (A_Idx) = N_Expanded_Name
- then
+ elsif Nkind_In (A_Idx, N_Identifier, N_Expanded_Name) then
A_Range := Scalar_Range (Entity (A_Idx));
else pragma Assert (Nkind (A_Idx) = N_Subtype_Indication);
-- Similarly if the indexed component appears as the prefix of an
-- attribute we don't want to evaluate it, because at least for
- -- some cases of attributes we need the identify (e.g. Access, Size)
+ -- some cases of attributes we need the identify (e.g. Access, Size).
elsif Nkind (Parent (N)) = N_Attribute_Reference then
return;
-- and misleading warnings.
if (Nkind_In (Par, N_Case_Expression_Alternative, N_If_Expression)
- or else Nkind (Parent (N)) not in N_Subexpr)
+ or else Nkind (Par) not in N_Subexpr)
and then (not Nkind_In (Par, N_Case_Expression_Alternative,
N_If_Expression)
or else Comes_From_Source (N))
-------------------------------
-- A qualified expression is potentially static if its subtype mark denotes
- -- a static subtype and its expression is potentially static (RM 4.9 (11)).
+ -- a static subtype and its expression is potentially static (RM 4.9 (10)).
procedure Eval_Qualified_Expression (N : Node_Id) is
Operand : constant Node_Id := Expression (N);
then
Check_Non_Static_Context (Operand);
- -- If operand is known to raise constraint_error, set the flag on the
+ -- If operand is known to raise Constraint_Error, set the flag on the
-- expression so it does not get optimized away.
if Nkind (Operand) = N_Raise_Constraint_Error then
return;
end if;
- -- Here we will fold, save Print_In_Hex indication
-
- Hex := Nkind (Operand) = N_Integer_Literal
- and then Print_In_Hex (Operand);
-
-- Fold the result of qualification
if Is_Discrete_Type (Target_Type) then
+
+ -- Save Print_In_Hex indication
+
+ Hex := Nkind (Operand) = N_Integer_Literal
+ and then Print_In_Hex (Operand);
+
Fold_Uint (N, Expr_Value (Operand), Stat);
-- Preserve Print_In_Hex indication