(N : Node_Id;
Op1 : Node_Id;
Op2 : Node_Id);
- -- If an boolean array assignment can be done in place, build call to
+ -- If a boolean array assignment can be done in place, build call to
-- corresponding library procedure.
procedure Displace_Allocator_Pointer (N : Node_Id);
PtrT : Entity_Id;
begin
+ -- Do nothing in case of VM targets: the virtual machine will handle
+ -- interfaces directly.
+
+ if VM_Target /= No_VM then
+ return;
+ end if;
+
pragma Assert (Nkind (N) = N_Identifier
and then Nkind (Orig_Node) = N_Allocator);
if Is_Class_Wide_Type (Etype (Exp))
and then Is_Interface (Etype (Exp))
+ and then VM_Target = No_VM
then
Set_Expression
(Expression (N),
begin
P := Parent (N);
while Present (P) loop
- if Nkind (P) = N_Extended_Return_Statement
- or else Nkind (P) = N_Simple_Return_Statement
+ if Nkind_In
+ (P, N_Extended_Return_Statement, N_Simple_Return_Statement)
then
return True;
New_Occurrence_Of
(Entity (Nam), Sloc (Nam)), T);
- elsif (Nkind (Nam) = N_Indexed_Component
- or else Nkind (Nam) = N_Selected_Component)
+ elsif Nkind_In
+ (Nam, N_Indexed_Component, N_Selected_Component)
and then Is_Entity_Name (Prefix (Nam))
then
Decls :=
if Nkind (Parnt) = N_Unchecked_Expression then
null;
- elsif Nkind (Parnt) = N_Object_Renaming_Declaration
- or else Nkind (Parnt) = N_Procedure_Call_Statement
+ elsif Nkind_In (Parnt, N_Object_Renaming_Declaration,
+ N_Procedure_Call_Statement)
or else (Nkind (Parnt) = N_Parameter_Association
and then
Nkind (Parent (Parnt)) = N_Procedure_Call_Statement)
then
return;
- elsif (Nkind (Parnt) = N_Indexed_Component
- or else Nkind (Parnt) = N_Selected_Component)
+ elsif Nkind_In (Parnt, N_Indexed_Component, N_Selected_Component)
and then Prefix (Parnt) = Child
then
null;
-- Special case the negation of a binary operation
- elsif (Nkind (Opnd) = N_Op_And
- or else Nkind (Opnd) = N_Op_Or
- or else Nkind (Opnd) = N_Op_Xor)
+ elsif Nkind_In (Opnd, N_Op_And, N_Op_Or, N_Op_Xor)
and then Safe_In_Place_Array_Op
- (Name (Parent (N)), Left_Opnd (Opnd), Right_Opnd (Opnd))
+ (Name (Parent (N)), Left_Opnd (Opnd), Right_Opnd (Opnd))
then
Build_Boolean_Array_Proc_Call (Parent (N), Opnd, Empty);
return;
-- expression, since these are additional cases that do can
-- appear on procedure actuals.
- elsif Nkind (Par) = N_Type_Conversion
- or else Nkind (Par) = N_Parameter_Association
- or else Nkind (Par) = N_Qualified_Expression
+ elsif Nkind_In (Par, N_Type_Conversion,
+ N_Parameter_Association,
+ N_Qualified_Expression)
then
Par := Parent (Par);
-- For identifiers and indexed components, it is sufficent to have a
-- constrained Unchecked_Union nominal subtype.
- if Nkind (N) = N_Identifier
- or else
- Nkind (N) = N_Indexed_Component
- then
+ if Nkind_In (N, N_Identifier, N_Indexed_Component) then
return Is_Unchecked_Union (Base_Type (Etype (N)))
and then
Is_Constrained (Etype (N));
elsif Is_Entity_Name (Op) then
return Is_Unaliased (Op);
- elsif Nkind (Op) = N_Indexed_Component
- or else Nkind (Op) = N_Selected_Component
- then
+ elsif Nkind_In (Op, N_Indexed_Component, N_Selected_Component) then
return Is_Unaliased (Prefix (Op));
elsif Nkind (Op) = N_Slice then