+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
-- 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
-----------------------------------
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;
--------------------------------------
function Is_Unchecked_Conversion_Instance (Id : Entity_Id) return Boolean is
+ Par : Node_Id;
Gen_Par : Entity_Id;
begin
-- 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)
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 --