Commit b2c3160c by Arnaud Charlet

[multiple changes]

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.

From-SVN: r251870
parent cc3a2986
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):
......
......@@ -2730,8 +2730,8 @@ package Einfo is
-- 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
......
......@@ -4632,7 +4632,9 @@ package body Exp_Ch4 is
-- No initialization required
else
null;
Build_Allocate_Deallocate_Proc
(N => N,
Is_Allocate => True);
end if;
-- Case of initialization procedure present, must be called
......
......@@ -8199,7 +8199,8 @@ package body Sem_Attr is
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
......
......@@ -3974,7 +3974,7 @@ package body Sem_Ch13 is
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
......
......@@ -9576,9 +9576,18 @@ package body Sem_Ch3 is
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.
......
......@@ -198,12 +198,17 @@ package body Sem_Util is
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);
......
......@@ -37,8 +37,9 @@ with Urealp; use Urealp;
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
......
......@@ -6,7 +6,7 @@
* *
* 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- *
......@@ -39,6 +39,9 @@
#include <vxWorks.h>
#include <arch/../regs.h>
#ifndef __RTP__
#if defined(__i386__)
#include <version.h>
#endif
#include <sigLib.h>
#else
#include <signal.h>
......@@ -127,11 +130,13 @@ void __gnat_sigtramp (int signo, void *si, void *sc,
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 : */
......@@ -141,7 +146,9 @@ void __gnat_sigtramp (int signo, void *si, void *sc,
/* 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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment