or else
Covers (T1 => T2, T2 => T1)
then
- if T1 = Universal_Integer
- or else T1 = Universal_Real
+ if Is_Universal_Numeric_Type (T1)
or else T1 = Any_Character
then
Add_One_Interp (N, Base_Type (T2), Base_Type (T2));
function Specific_Type (T1, T2 : Entity_Id) return Entity_Id is
begin
- if T1 = Universal_Integer or else T1 = Universal_Real then
+ if Is_Universal_Numeric_Type (T1) then
return Base_Type (T2);
else
return Base_Type (T1);
if Ada_Version >= Ada_2005
and then It.Typ = Typ
- and then Typ /= Universal_Integer
- and then Typ /= Universal_Real
+ and then not Is_Universal_Numeric_Type (Typ)
and then Present (It.Abstract_Op)
then
if Debug_Flag_V then
if not Is_Overloaded (N) then
T := Etype (N);
return Base_Type (T) = Base_Type (Standard_Integer)
- or else T = Universal_Integer
- or else T = Universal_Real;
+ or else Is_Universal_Numeric_Type (T);
else
Get_First_Interp (N, Index, It);
while Present (It.Typ) loop
if Base_Type (It.Typ) = Base_Type (Standard_Integer)
- or else It.Typ = Universal_Integer
- or else It.Typ = Universal_Real
+ or else Is_Universal_Numeric_Type (It.Typ)
then
return True;
end if;
elsif Universal_Interpretation (N) = Universal_Real
and then (T = Base_Type (Standard_Integer)
- or else T = Universal_Integer
- or else T = Universal_Real)
+ or else Is_Universal_Numeric_Type (T))
then
-- A universal real can appear in a fixed-type context. We resolve
-- the literal with that context, even though this might raise an
procedure Set_Operand_Type (N : Node_Id) is
begin
- if Etype (N) = Universal_Integer
- or else Etype (N) = Universal_Real
- then
+ if Is_Universal_Numeric_Type (Etype (N)) then
Set_Etype (N, T);
end if;
end Set_Operand_Type;
-- Set the type of the node to its universal interpretation because
-- legality checks on an exponentiation operand need the context.
- elsif (B_Typ = Universal_Integer or else B_Typ = Universal_Real)
+ elsif Is_Universal_Numeric_Type (B_Typ)
and then Present (Universal_Interpretation (L))
and then Present (Universal_Interpretation (R))
then
end if;
else
- if (TL = Universal_Integer or else TL = Universal_Real)
+ if Is_Universal_Numeric_Type (TL)
and then
- (TR = Universal_Integer or else TR = Universal_Real)
+ Is_Universal_Numeric_Type (TR)
then
Check_For_Visible_Operator (N, B_Typ);
end if;
goto SM_Exit;
elsif not Is_Overloaded (R)
- and then
- (Etype (R) = Universal_Integer
- or else
- Etype (R) = Universal_Real)
+ and then Is_Universal_Numeric_Type (Etype (R))
and then Is_Overloaded (L)
then
T := Etype (R);
return;
end if;
- if Etype (Left_Opnd (N)) = Universal_Integer
- or else Etype (Left_Opnd (N)) = Universal_Real
- then
+ if Is_Universal_Numeric_Type (Etype (Left_Opnd (N))) then
Check_For_Visible_Operator (N, B_Typ);
end if;
-- Deal with universal cases
- if Etype (R) = Universal_Integer
- or else
- Etype (R) = Universal_Real
- then
+ if Is_Universal_Numeric_Type (Etype (R)) then
Check_For_Visible_Operator (N, B_Typ);
end if;
if Nkind (Opnd) = N_Defining_Identifier
or else not Is_Overloaded (Opnd)
then
- if Etype (Opnd) = Universal_Integer
- or else Etype (Opnd) = Universal_Real
- then
+ if Is_Universal_Numeric_Type (Etype (Opnd)) then
return Etype (Opnd);
else
return Empty;
else
Get_First_Interp (Opnd, Index, It);
while Present (It.Typ) loop
- if It.Typ = Universal_Integer
- or else It.Typ = Universal_Real
- then
+ if Is_Universal_Numeric_Type (It.Typ) then
return It.Typ;
end if;