+2017-09-08 Bob Duff <duff@adacore.com>
+
+ * sem_ch3.adb (Build_Derived_Private_Type): Inherit
+ representation items from interfaces that the derived type
+ implements, not just from the parent type.
+ * sem_util.ads, sem_util.adb (Abstract_Interface_List): Change
+ this to return an empty list when there are no interfaces.
+ * einfo.ads, sem_ch13.adb: Minor comment fixes.
+ * sem_attr.adb: Minor comment fix.
+
+2017-09-08 Doug Rupp <rupp@adacore.com>
+
+ * sigtramp-vxworks.c [i386]: Adjust the kernel context for
+ x86-vx7.
+
+2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_ch4.adb (Expand_N_Allocator): Generate a
+ call to Allocate_Any_Controlled when the allocation does not
+ require any initialization.
+
2017-09-08 Hristian Kirtchev <kirtchev@adacore.com>
* sem_util.adb (Copy_Node_With_Replacement):
-- Is_Interface (Flag186)
-- Defined in record types and subtypes. Set to indicate that the current
--- entity corresponds with an abstract interface. Because abstract
--- interfaces are conceptually a special kind of abstract tagged types
+-- entity corresponds to an abstract interface. Because abstract
+-- interfaces are conceptually a special kind of abstract tagged type
-- we represent them by means of tagged record types and subtypes
-- marked with this attribute. This allows us to reuse most of the
-- compiler support for abstract tagged types to implement interfaces
-- No initialization required
else
- null;
+ Build_Allocate_Deallocate_Proc
+ (N => N,
+ Is_Allocate => True);
end if;
-- Case of initialization procedure present, must be called
case Id is
- -- Attributes related to Ada 2012 iterators (placeholder ???)
+ -- Attributes related to Ada 2012 iterators; nothing to evaluate for
+ -- these.
when Attribute_Constant_Indexing
| Attribute_Default_Iterator
procedure Check_Iterator_Functions;
-- Check that there is a single function in Default_Iterator attribute
- -- has the proper type structure.
+ -- that has the proper type structure.
function Check_Primitive_Function (Subp : Entity_Id) return Boolean;
-- Common legality check for the previous two
Set_Has_Predicates (Derived_Type);
end if;
- -- The derived type inherits the representation clauses of the parent
+ -- The derived type inherits representation clauses from the parent
+ -- type, and from any interfaces.
Inherit_Rep_Item_Chain (Derived_Type, Parent_Type);
+ declare
+ Iface : Node_Id := First (Abstract_Interface_List (Derived_Type));
+ begin
+ while Present (Iface) loop
+ Inherit_Rep_Item_Chain (Derived_Type, Entity (Iface));
+ Next (Iface);
+ end loop;
+ end;
-- If the parent type has delayed rep aspects, then mark the derived
-- type as possibly inheriting a delayed rep aspect.
return Abstract_Interface_List (Etype (Typ));
- else pragma Assert ((Ekind (Typ)) = E_Record_Type);
+ elsif Ekind (Typ) = E_Record_Type then
if Nkind (Parent (Typ)) = N_Formal_Type_Declaration then
Nod := Formal_Type_Definition (Parent (Typ));
else
Nod := Type_Definition (Parent (Typ));
end if;
+
+ -- It's not the kind of type that can implement interfaces
+
+ else
+ return Empty_List;
end if;
return Interface_List (Nod);
package Sem_Util is
function Abstract_Interface_List (Typ : Entity_Id) return List_Id;
- -- Given a type that implements interfaces look for its associated
- -- definition node and return its list of interfaces.
+ -- The list of interfaces implemented by Typ. Empty if there are none,
+ -- including the cases where there can't be any because e.g. the type is
+ -- not tagged.
procedure Add_Access_Type_To_Process (E : Entity_Id; A : Entity_Id);
-- Add A to the list of access types to process when expanding the
* *
* Asm Implementation File *
* *
- * Copyright (C) 2011-2015, Free Software Foundation, Inc. *
+ * Copyright (C) 2011-2017, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
#include <vxWorks.h>
#include <arch/../regs.h>
#ifndef __RTP__
+#if defined(__i386__)
+#include <version.h>
+#endif
#include <sigLib.h>
#else
#include <signal.h>
containing a complete REG_SET just before the field 'sc_pregs', this
adds a 208 bytes offset to get the value of 'sc_pregs'.
* on x86-vx7: the same offset is used on vx7: 3 32-bit values are present
- at the enf of the reg set, but the padding is then of 0xc4 characters.
+ at the end of the reg set, but the padding is then of 0xc4 characters.
* on x86_64-vx7: two 64-bit values are added at the beginning of the
REG_SET. This adds a 16 bytes offset to get the value of 'sc_pregs',
and another 16 bytes offset within the pregs structure to retrieve the
registers list.
+
+ * See header file regsSimlinux.h.
*/
/* Retrieve the registers to restore : */
/* move sctx 208 bytes further, so that the vxsim's sc_pregs field coincide
with the expected x86 one */
struct sigcontext * sctx =
- (struct sigcontext *) (sc + (__gnat_is_vxsim ? 208 : 0));
+ (struct sigcontext *) (sc + (__gnat_is_vxsim ?
+ (_WRS_VXWORKS_MAJOR == 7 ? 204 : 208)
+ : 0));
#elif defined(__x86_64__)
/* move sctx 16 bytes further, so that the vxsim's sc_pregs field coincide
with the expected x86_64 one */