[multiple changes]

2016-04-20  Arnaud Charlet  <charlet@adacore.com>

	* snames.ads-tmpl (Internal_Attribute_Id, Attribute_Class_Array): Fix
	indentation.
	* sem_util.adb (Is_Unchecked_Conversion_Instance):
	defense against library-level renamings of other functions,
	which are never instances of Unchecked_Conversion.
	* einfo.ads: minor fix of casing in comment

2016-04-20  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch6.adb (Expand_N_Subprogram_Stub): Do not expand a body
	that has been analyzed and expanded already. Qualify the names
	in the proper body for use in the generation of C code.

From-SVN: r235244
This commit is contained in:
Arnaud Charlet 2016-04-20 11:14:02 +02:00
parent 1ba563f5f9
commit 31ae1b4629
5 changed files with 44 additions and 9 deletions

View File

@ -1,3 +1,18 @@
2016-04-20 Arnaud Charlet <charlet@adacore.com>
* snames.ads-tmpl (Internal_Attribute_Id, Attribute_Class_Array): Fix
indentation.
* sem_util.adb (Is_Unchecked_Conversion_Instance):
defense against library-level renamings of other functions,
which are never instances of Unchecked_Conversion.
* einfo.ads: minor fix of casing in comment
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_N_Subprogram_Stub): Do not expand a body
that has been analyzed and expanded already. Qualify the names
in the proper body for use in the generation of C code.
2016-04-20 Javier Miranda <miranda@adacore.com>
* contracts.adb (Build_Postconditions_Procedure): Force its

View File

@ -4441,9 +4441,9 @@ package Einfo is
-- protected operation, etc).
-- b) Alias applies to overloadable entities, and the value is an overloadable
-- entity. so this is a subset of the previous one. We use the term Alias to
-- entity. So this is a subset of the previous one. We use the term Alias to
-- cover both renamings and inherited operations, because both cases are
-- handled in the same way when expanding a call. namely the Alias of a given
-- handled in the same way when expanding a call. Namely the Alias of a given
-- subprogram is the subprogram that will actually be called.
-- Both a) and b) are set transitively, so that in fact it is not necessary to

View File

@ -5521,10 +5521,23 @@ package body Exp_Ch6 is
-----------------------------------
procedure Expand_N_Subprogram_Body_Stub (N : Node_Id) is
Bod : Node_Id;
begin
if Present (Corresponding_Body (N)) then
Expand_N_Subprogram_Body (
Unit_Declaration_Node (Corresponding_Body (N)));
Bod := Unit_Declaration_Node (Corresponding_Body (N));
-- The body may have been expanded already when it is analyzed
-- through the subunit node. Do no expand again: it interferes
-- with the construction of unnesting tables when generating C.
if not Analyzed (Bod) then
Expand_N_Subprogram_Body (Bod);
end if;
-- Add full qualification to entities that may be created late
-- during unnesting.
Qualify_Entity_Names (N);
end if;
end Expand_N_Subprogram_Body_Stub;

View File

@ -14282,6 +14282,7 @@ package body Sem_Util is
--------------------------------------
function Is_Unchecked_Conversion_Instance (Id : Entity_Id) return Boolean is
Par : Node_Id;
Gen_Par : Entity_Id;
begin
@ -14289,7 +14290,13 @@ package body Sem_Util is
-- function Unchecked_Conversion.
if Ekind (Id) = E_Function then
Gen_Par := Generic_Parent (Parent (Id));
Par := Parent (Id);
if Nkind (Par) /= N_Function_Specification then
return False;
end if;
Gen_Par := Generic_Parent (Par);
return
Present (Gen_Par)

View File

@ -1677,11 +1677,11 @@ package Snames is
Attribute_Dispatching_Domain,
Attribute_Interrupt_Priority);
subtype Internal_Attribute_Id is Attribute_Id range
Attribute_CPU .. Attribute_Interrupt_Priority;
subtype Internal_Attribute_Id is Attribute_Id range
Attribute_CPU .. Attribute_Interrupt_Priority;
type Attribute_Class_Array is array (Attribute_Id) of Boolean;
-- Type used to build attribute classification flag arrays
type Attribute_Class_Array is array (Attribute_Id) of Boolean;
-- Type used to build attribute classification flag arrays
------------------------------------
-- Convention Name ID Definitions --