-- preference rule applies.
if (((Ekind (Name) = E_Function or else Ekind (Name) = E_Procedure)
- and then Ekind (Name) = Ekind (It.Nam))
- or else (Ekind (Name) = E_Operator
- and then Ekind (It.Nam) = E_Function))
-
+ and then Ekind (Name) = Ekind (It.Nam))
+ or else (Ekind (Name) = E_Operator
+ and then Ekind (It.Nam) = E_Function))
and then Is_Immediately_Visible (It.Nam)
and then Type_Conformant (Name, It.Nam)
and then Base_Type (It.Typ) = Base_Type (T)
-- predefined operator in any case.
elsif Nkind (N) = N_Operator_Symbol
- or else (Nkind (N) = N_Expanded_Name
- and then
- Nkind (Selector_Name (N)) = N_Operator_Symbol)
+ or else
+ (Nkind (N) = N_Expanded_Name
+ and then Nkind (Selector_Name (N)) = N_Operator_Symbol)
then
exit;
or else Is_Potentially_Use_Visible (Vis_Type)
or else In_Use (Vis_Type)
or else (In_Use (Scope (Vis_Type))
- and then not Is_Hidden (Vis_Type))
+ and then not Is_Hidden (Vis_Type))
or else Nkind (N) = N_Expanded_Name
or else (Nkind (N) in N_Op and then E = Entity (N))
or else In_Instance
elsif Nkind (N) = N_Function_Call
and then Nkind (Name (N)) = N_Expanded_Name
and then (Entity (Prefix (Name (N))) = Scope (Base_Type (T))
- or else Entity (Prefix (Name (N))) = Scope (Vis_Type)
- or else Scope (Vis_Type) = System_Aux_Id)
+ or else Entity (Prefix (Name (N))) = Scope (Vis_Type)
+ or else Scope (Vis_Type) = System_Aux_Id)
then
null;
elsif Interp_Map.Last < 0
or else
(Interp_Map.Table (Interp_Map.Last).Node /= N
- and then not Is_Overloaded (N))
+ and then not Is_Overloaded (N))
then
New_Interps (N);
if Scop = Inst then
return True;
end if;
+
Scop := Scope (Scop);
end loop;
exit when (not Is_Overloadable (H))
and then Is_Immediately_Visible (H);
- if Is_Immediately_Visible (H)
- and then H /= Ent
- then
+ if Is_Immediately_Visible (H) and then H /= Ent then
+
-- Only add interpretation if not hidden by an inner
-- immediately visible one.
Is_Private_Type (Typ1)
and then
((Present (Full_View (Typ1))
- and then Covers (Full_View (Typ1), Typ2))
- or else Base_Type (Typ1) = Typ2
- or else Base_Type (Typ2) = Typ1);
+ and then Covers (Full_View (Typ1), Typ2))
+ or else Base_Type (Typ1) = Typ2
+ or else Base_Type (Typ2) = Typ1);
end Full_View_Covers;
-----------------
elsif Is_Class_Wide_Type (T2)
and then
(Class_Wide_Type (T1) = Class_Wide_Type (T2)
- or else Base_Type (Root_Type (T2)) = BT1)
+ or else Base_Type (Root_Type (T2)) = BT1)
then
return True;
-- An aggregate is compatible with an array or record type
- elsif T2 = Any_Composite
- and then Is_Aggregate_Type (T1)
- then
+ elsif T2 = Any_Composite and then Is_Aggregate_Type (T1) then
return True;
-- If the expected type is an anonymous access, the designated type must
and then (not Comes_From_Source (T1)
or else not Comes_From_Source (T2))
and then (Is_Overloadable (Designated_Type (T2))
- or else
- Ekind (Designated_Type (T2)) = E_Subprogram_Type)
- and then
- Type_Conformant (Designated_Type (T1), Designated_Type (T2))
- and then
- Mode_Conformant (Designated_Type (T1), Designated_Type (T2))
+ or else Ekind (Designated_Type (T2)) = E_Subprogram_Type)
+ and then Type_Conformant (Designated_Type (T1), Designated_Type (T2))
+ and then Mode_Conformant (Designated_Type (T1), Designated_Type (T2))
then
return True;
and then (not Comes_From_Source (T1)
or else not Comes_From_Source (T2))
and then (Is_Overloadable (Designated_Type (T2))
- or else
- Ekind (Designated_Type (T2)) = E_Subprogram_Type)
- and then
- Type_Conformant (Designated_Type (T1), Designated_Type (T2))
- and then
- Mode_Conformant (Designated_Type (T1), Designated_Type (T2))
+ or else Ekind (Designated_Type (T2)) = E_Subprogram_Type)
+ and then Type_Conformant (Designated_Type (T1), Designated_Type (T2))
+ and then Mode_Conformant (Designated_Type (T1), Designated_Type (T2))
then
return True;
-- vice versa.
elsif Is_Record_Type (T1)
- and then (Is_Remote_Call_Interface (T1)
- or else Is_Remote_Types (T1))
+ and then (Is_Remote_Call_Interface (T1) or else Is_Remote_Types (T1))
and then Present (Corresponding_Remote_Type (T1))
then
return Covers (Corresponding_Remote_Type (T1), T2);
-- and conversely.
elsif Is_Record_Type (T2)
- and then (Is_Remote_Call_Interface (T2)
- or else Is_Remote_Types (T2))
+ and then (Is_Remote_Call_Interface (T2) or else Is_Remote_Types (T2))
and then Present (Corresponding_Remote_Type (T2))
then
return Covers (Corresponding_Remote_Type (T2), T1);
-- Ditto for allocators, which eventually resolve to the context type
- elsif Ekind (T2) = E_Allocator_Type
- and then Is_Access_Type (T1)
- then
+ elsif Ekind (T2) = E_Allocator_Type and then Is_Access_Type (T1) then
return Covers (Designated_Type (T1), Designated_Type (T2))
- or else
- (From_Limited_With (Designated_Type (T1))
- and then Covers (Designated_Type (T2), Designated_Type (T1)));
+ or else
+ (From_Limited_With (Designated_Type (T1))
+ and then Covers (Designated_Type (T2), Designated_Type (T1)));
-- A boolean operation on integer literals is compatible with modular
-- context.
- elsif T2 = Any_Modular
- and then Is_Modular_Integer_Type (T1)
- then
+ elsif T2 = Any_Modular and then Is_Modular_Integer_Type (T1) then
return True;
-- The actual type may be the result of a previous error
-- legal, to prevent cascaded errors.
elsif In_Instance
- and then
- (Full_View_Covers (T1, T2)
- or else Full_View_Covers (T2, T1))
+ and then (Full_View_Covers (T1, T2) or else Full_View_Covers (T2, T1))
then
return True;
elsif In_Inlined_Body
and then (Underlying_Type (T1) = Underlying_Type (T2)
- or else (Is_Access_Type (T1)
- and then Is_Access_Type (T2)
- and then
- Designated_Type (T1) = Designated_Type (T2))
- or else (T1 = Any_Access
- and then Is_Access_Type (Underlying_Type (T2)))
- or else (T2 = Any_Composite
- and then
- Is_Composite_Type (Underlying_Type (T1))))
+ or else
+ (Is_Access_Type (T1)
+ and then Is_Access_Type (T2)
+ and then Designated_Type (T1) = Designated_Type (T2))
+ or else
+ (T1 = Any_Access
+ and then Is_Access_Type (Underlying_Type (T2)))
+ or else
+ (T2 = Any_Composite
+ and then Is_Composite_Type (Underlying_Type (T1))))
then
return True;
else
return Is_Entity_Name (Subtype_Indication (Type_Definition (Par)))
and then
- Is_Generic_Actual_Type (
- Entity (Subtype_Indication (Type_Definition (Par))));
+ Is_Generic_Actual_Type (
+ Entity (Subtype_Indication (Type_Definition (Par))));
end if;
end Inherited_From_Actual;
return In_Same_List (Parent (Typ), Op_Decl)
or else
(Ekind_In (Scop, E_Package, E_Generic_Package)
- and then List_Containing (Op_Decl) =
- Visible_Declarations (Parent (Scop))
- and then List_Containing (Parent (Typ)) =
- Private_Declarations (Parent (Scop)));
+ and then List_Containing (Op_Decl) =
+ Visible_Declarations (Parent (Scop))
+ and then List_Containing (Parent (Typ)) =
+ Private_Declarations (Parent (Scop)));
end In_Same_Declaration_List;
--------------------------
begin
Get_First_Interp (N, I, It);
while Present (It.Typ) loop
- if (Covers (Typ, It.Typ)
- or else Typ = Any_Type)
+ if (Covers (Typ, It.Typ) or else Typ = Any_Type)
and then
(It.Typ = Universal_Integer
or else It.Typ = Universal_Real)
-- handled here as well. We test Comes_From_Source to exclude this
-- treatment for implicit renamings created for formal subprograms.
- elsif In_Instance
- and then not In_Generic_Actual (N)
- then
+ elsif In_Instance and then not In_Generic_Actual (N) then
if Nkind (N) in N_Subprogram_Call
or else
(Nkind (N) in N_Has_Entity
else
if (In_Open_Scopes (Scope (User_Subp))
- or else Is_Potentially_Use_Visible (User_Subp))
+ or else Is_Potentially_Use_Visible (User_Subp))
and then not In_Instance
then
if Is_Fixed_Point_Type (Typ)
then
return Type_Conformant (New_S, Old_S);
- elsif Ekind (New_S) = E_Function
- and then Ekind (Old_S) = E_Operator
- then
+ elsif Ekind (New_S) = E_Function and then Ekind (Old_S) = E_Operator then
return Operator_Matches_Spec (Old_S, New_S);
- elsif Ekind (New_S) = E_Procedure
- and then Is_Entry (Old_S)
- then
+ elsif Ekind (New_S) = E_Procedure and then Is_Entry (Old_S) then
return Type_Conformant (New_S, Old_S);
else
-- apply preference rule.
if TR /= Any_Type then
-
if (T = Universal_Integer or else T = Universal_Real)
and then It.Typ = T
then
-- is no rule in 4.6 that allows "access Integer" to be converted to P.
elsif Ada_Version >= Ada_2005
- and then
- (Ekind (Etype (L)) = E_Anonymous_Access_Type
- or else
- Ekind (Etype (L)) = E_Anonymous_Access_Subprogram_Type)
+ and then Ekind_In (Etype (L), E_Anonymous_Access_Type,
+ E_Anonymous_Access_Subprogram_Type)
and then Is_Access_Type (Etype (R))
and then Ekind (Etype (R)) /= E_Access_Type
then
return Etype (L);
elsif Ada_Version >= Ada_2005
- and then
- (Ekind (Etype (R)) = E_Anonymous_Access_Type
- or else Ekind (Etype (R)) = E_Anonymous_Access_Subprogram_Type)
+ and then Ekind_In (Etype (R), E_Anonymous_Access_Type,
+ E_Anonymous_Access_Subprogram_Type)
and then Is_Access_Type (Etype (L))
and then Ekind (Etype (L)) /= E_Access_Type
then
if Is_Overloaded (N) and then Is_Overloadable (E) then
Act_Parm := First_Actual (N);
Form_Parm := First_Formal (E);
- while Present (Act_Parm)
- and then Present (Form_Parm)
- loop
+ while Present (Act_Parm) and then Present (Form_Parm) loop
Act := Act_Parm;
if Nkind (Act) = N_Parameter_Association then
or else
(Is_Record_Type (Typ)
- and then Is_Concurrent_Type (Etype (N))
- and then Present (Corresponding_Record_Type (Etype (N)))
- and then Covers (Typ, Corresponding_Record_Type (Etype (N))))
+ and then Is_Concurrent_Type (Etype (N))
+ and then Present (Corresponding_Record_Type (Etype (N)))
+ and then Covers (Typ, Corresponding_Record_Type (Etype (N))))
or else
(Is_Concurrent_Type (Typ)
- and then Is_Record_Type (Etype (N))
- and then Present (Corresponding_Record_Type (Typ))
- and then Covers (Corresponding_Record_Type (Typ), Etype (N)))
+ and then Is_Record_Type (Etype (N))
+ and then Present (Corresponding_Record_Type (Typ))
+ and then Covers (Corresponding_Record_Type (Typ), Etype (N)))
or else
(not Is_Tagged_Type (Typ)
- and then Ekind (Typ) /= E_Anonymous_Access_Type
- and then Covers (Etype (N), Typ));
+ and then Ekind (Typ) /= E_Anonymous_Access_Type
+ and then Covers (Etype (N), Typ));
+
+ -- Overloaded case
else
Get_First_Interp (N, I, It);
begin
return Operator_Matches_Spec (Op, F)
and then (In_Open_Scopes (Scope (F))
- or else Scope (F) = Scope (Btyp)
- or else (not In_Open_Scopes (Scope (Btyp))
- and then not In_Use (Btyp)
- and then not In_Use (Scope (Btyp))));
+ or else Scope (F) = Scope (Btyp)
+ or else (not In_Open_Scopes (Scope (Btyp))
+ and then not In_Use (Btyp)
+ and then not In_Use (Scope (Btyp))));
end Hides_Op;
------------------------
return True;
elsif Present (Interfaces (Etype (AI)))
- and then Iface_Present_In_Ancestor (Etype (AI))
+ and then Iface_Present_In_Ancestor (Etype (AI))
then
return True;
end if;
-- Ada 2005 (AI-251): Complete the error notification
elsif Is_Class_Wide_Type (Etype (R))
- and then Is_Interface (Etype (Class_Wide_Type (Etype (R))))
+ and then Is_Interface (Etype (Class_Wide_Type (Etype (R))))
then
Error_Msg_NE ("(Ada 2005) does not implement interface }",
L, Etype (Class_Wide_Type (Etype (R))));
-
else
Error_Msg_N ("incompatible types", Parent (L));
end if;
elsif BT1 = Base_Type (Par)
or else (Is_Private_Type (T1)
- and then Present (Full_View (T1))
- and then Base_Type (Par) = Base_Type (Full_View (T1)))
+ and then Present (Full_View (T1))
+ and then Base_Type (Par) = Base_Type (Full_View (T1)))
then
return True;
return Is_Array_Type (T)
and then (Base_Type (T) = Base_Type (Etype (Op)))
and then (Base_Type (T1) = Base_Type (T)
- or else
+ or else
Base_Type (T1) = Base_Type (Component_Type (T)))
and then (Base_Type (T2) = Base_Type (T)
- or else
+ or else
Base_Type (T2) = Base_Type (Component_Type (T)));
else
then
return T1;
- elsif T2 = Any_Composite
- and then Is_Aggregate_Type (T1)
- then
+ elsif T2 = Any_Composite and then Is_Aggregate_Type (T1) then
return T1;
- elsif T1 = Any_Composite
- and then Is_Aggregate_Type (T2)
- then
+ elsif T1 = Any_Composite and then Is_Aggregate_Type (T2) then
return T2;
elsif T1 = Any_Modular and then Is_Modular_Integer_Type (T2) then
elsif Is_Class_Wide_Type (T2)
and then Is_Interface (Etype (T2))
- and then Interface_Present_In_Ancestor (Typ => T1,
+ and then Interface_Present_In_Ancestor (Typ => T1,
Iface => Etype (T2))
then
return T1;
then
return T2;
- elsif (Ekind (B1) = E_Access_Subprogram_Type
- or else
- Ekind (B1) = E_Access_Protected_Subprogram_Type)
+ elsif Ekind_In (B1, E_Access_Subprogram_Type,
+ E_Access_Protected_Subprogram_Type)
and then Ekind (Designated_Type (B1)) /= E_Subprogram_Type
and then Is_Access_Type (T2)
then
return T2;
- elsif (Ekind (B2) = E_Access_Subprogram_Type
- or else
- Ekind (B2) = E_Access_Protected_Subprogram_Type)
+ elsif Ekind_In (B2, E_Access_Subprogram_Type,
+ E_Access_Protected_Subprogram_Type)
and then Ekind (Designated_Type (B2)) /= E_Subprogram_Type
and then Is_Access_Type (T1)
then
return T1;
- elsif (Ekind (T1) = E_Allocator_Type
- or else Ekind (T1) = E_Access_Attribute_Type
- or else Ekind (T1) = E_Anonymous_Access_Type)
+ elsif Ekind_In (T1, E_Allocator_Type,
+ E_Access_Attribute_Type,
+ E_Anonymous_Access_Type)
and then Is_Access_Type (T2)
then
return T2;
- elsif (Ekind (T2) = E_Allocator_Type
- or else Ekind (T2) = E_Access_Attribute_Type
- or else Ekind (T2) = E_Anonymous_Access_Type)
+ elsif Ekind_In (T2, E_Allocator_Type,
+ E_Access_Attribute_Type,
+ E_Anonymous_Access_Type)
and then Is_Access_Type (T1)
then
return T1;
and then Number_Dimensions (T) = 1
and then Is_Boolean_Type (Component_Type (T))
and then
- ((not Is_Private_Composite (T)
- and then not Is_Limited_Composite (T))
+ ((not Is_Private_Composite (T) and then not Is_Limited_Composite (T))
or else In_Instance
or else Available_Full_View_Of_Component (T))
then
elsif Is_Array_Type (T)
and then Number_Dimensions (T) = 1
and then Is_Discrete_Type (Component_Type (T))
- and then (not Is_Private_Composite (T)
- or else In_Instance)
- and then (not Is_Limited_Composite (T)
- or else In_Instance)
+ and then (not Is_Private_Composite (T) or else In_Instance)
+ and then (not Is_Limited_Composite (T) or else In_Instance)
then
return True;
-- for the current unit. The declarations are added in the current scope,
-- so the caller should push a new scope as required before the call.
+ function Address_Integer_Convert_OK (T1, T2 : Entity_Id) return Boolean;
+ -- Given two types, returns True if we are in Allow_Integer_Address mode
+ -- and one of the types is (a descendent of) System.Address (and this type
+ -- is private), and the other type is any integer type.
+
function Addressable (V : Uint) return Boolean;
function Addressable (V : Int) return Boolean;
pragma Inline (Addressable);
-- * Array-of-scalars with specified Default_Component_Value
-- * Array type with fully default initialized component type
-- * Record or protected type with components that either have a
- -- default expression or their related types are fully default
- -- initialized.
+ -- default expression or their related types are fully default
+ -- initialized.
-- * Scalar type with specified Default_Value
-- * Task type
-- * Type extension of a type with full default initialization where
- -- the extension components are also fully default initialized
+ -- the extension components are also fully default initialized.
Mixed_Initialization,
-- This value applies to a type where some of its internals are fully
function Default_Initialization
(Typ : Entity_Id) return Default_Initialization_Kind;
- -- Determine the default initialization kind that applies to a particular
- -- type.
+ -- Determine default initialization kind that applies to a particular type
function Deepest_Type_Access_Level (Typ : Entity_Id) return Uint;
-- Same as Type_Access_Level, except that if the type is the type of an Ada
function Is_CPP_Constructor_Call (N : Node_Id) return Boolean;
-- Returns True if N is a call to a CPP constructor
+ function Is_Child_Or_Sibling
+ (Pack_1 : Entity_Id;
+ Pack_2 : Entity_Id;
+ Private_Child : Boolean) return Boolean;
+ -- Determine the following relations between two arbitrary packages:
+ -- 1) One package is the parent of a child package
+ -- 2) Both packages are siblings and share a common parent
+ -- If flag Private_Child is set, then the child in case 1) or both siblings
+ -- in case 2) must be private.
+
+ function Is_Concurrent_Interface (T : Entity_Id) return Boolean;
+ -- First determine whether type T is an interface and then check whether
+ -- it is of protected, synchronized or task kind.
+
function Is_Dependent_Component_Of_Mutable_Object
(Object : Node_Id) return Boolean;
-- Returns True if Object is the name of a subcomponent that depends on
-- This is the RM definition, a type is a descendent of another type if it
-- is the same type or is derived from a descendent of the other type.
- function Is_Child_Or_Sibling
- (Pack_1 : Entity_Id;
- Pack_2 : Entity_Id;
- Private_Child : Boolean) return Boolean;
- -- Determine the following relations between two arbitrary packages:
- -- 1) One package is the parent of a child package
- -- 2) Both packages are siblings and share a common parent
- -- If flag Private_Child is set, then the child in case 1) or both siblings
- -- in case 2) must be private.
-
- function Is_Concurrent_Interface (T : Entity_Id) return Boolean;
- -- First determine whether type T is an interface and then check whether
- -- it is of protected, synchronized or task kind.
-
function Is_Expression_Function (Subp : Entity_Id) return Boolean;
-- Predicate to determine whether a scope entity comes from a rewritten
-- expression function call, and should be inlined unconditionally. Also