Commit 292689c2 by Arnaud Charlet

[multiple changes]

2011-10-24  Emmanuel Briot  <briot@adacore.com>

	* prj-proc.adb (Process_Expression_Variable_Decl): No special
	handling for Project_Path unless it is an attribute.

2011-10-24  Javier Miranda  <miranda@adacore.com>

	* sem_ch12.adb (Check_Hidden_Primitives): New subprogram.
	(Install_Hidden_Primitives): New subprogram.
	(Restore_Hidden_Primitives): New subprogram.
	(Analyze_Formal_Package_Declaration,
	Analyze_Package_Instantiation, Analyze_Subprogram_Instantiation):
	Invoke Check_Hidden_Primitives after every call to
	Analyze_Associations, and invoke Restore_Hidden_Primitives to
	restore their visibility after processing the instantiation.
	(Instantiate_Package_Body): Install visible primitives before
	analyzing the instantiation and uninstall them to restore their
	visibility when the instantiation has been analyzed.
	* sem_util.ads, sem_util.adb (Add_Suffix): New subprogram
	(Remove_Suffix): New subprogram
	* sem_ch3.adb (Derive_Subprogram): When handling
	a derived subprogram for the instantiation of a formal derived
	tagged type, inherit the dispatching attributes from the actual
	subprogram (not from the parent type).

From-SVN: r180370
parent db4b3c49
2011-10-24 Emmanuel Briot <briot@adacore.com>
* prj-proc.adb (Process_Expression_Variable_Decl): No special
handling for Project_Path unless it is an attribute.
2011-10-24 Javier Miranda <miranda@adacore.com>
* sem_ch12.adb (Check_Hidden_Primitives): New subprogram.
(Install_Hidden_Primitives): New subprogram.
(Restore_Hidden_Primitives): New subprogram.
(Analyze_Formal_Package_Declaration,
Analyze_Package_Instantiation, Analyze_Subprogram_Instantiation):
Invoke Check_Hidden_Primitives after every call to
Analyze_Associations, and invoke Restore_Hidden_Primitives to
restore their visibility after processing the instantiation.
(Instantiate_Package_Body): Install visible primitives before
analyzing the instantiation and uninstall them to restore their
visibility when the instantiation has been analyzed.
* sem_util.ads, sem_util.adb (Add_Suffix): New subprogram
(Remove_Suffix): New subprogram
* sem_ch3.adb (Derive_Subprogram): When handling
a derived subprogram for the instantiation of a formal derived
tagged type, inherit the dispatching attributes from the actual
subprogram (not from the parent type).
2011-10-24 Vasiliy Fofanov <fofanov@adacore.com> 2011-10-24 Vasiliy Fofanov <fofanov@adacore.com>
* gnat_ugn.texi: Document explicit use of XDECGNAT library. * gnat_ugn.texi: Document explicit use of XDECGNAT library.
......
...@@ -2053,7 +2053,7 @@ package body Prj.Proc is ...@@ -2053,7 +2053,7 @@ package body Prj.Proc is
Shared.Variable_Elements.Table (Var).Value := New_Value; Shared.Variable_Elements.Table (Var).Value := New_Value;
end if; end if;
if Name = Snames.Name_Project_Path then if Is_Attribute and then Name = Snames.Name_Project_Path then
if In_Tree.Is_Root_Tree then if In_Tree.Is_Root_Tree then
declare declare
Val : String_List_Id := New_Value.Values; Val : String_List_Id := New_Value.Values;
......
...@@ -13318,18 +13318,18 @@ package body Sem_Ch3 is ...@@ -13318,18 +13318,18 @@ package body Sem_Ch3 is
-- Check for case of a derived subprogram for the instantiation of a -- Check for case of a derived subprogram for the instantiation of a
-- formal derived tagged type, if so mark the subprogram as dispatching -- formal derived tagged type, if so mark the subprogram as dispatching
-- and inherit the dispatching attributes of the parent subprogram. The -- and inherit the dispatching attributes of the actual subprogram. The
-- derived subprogram is effectively renaming of the actual subprogram, -- derived subprogram is effectively renaming of the actual subprogram,
-- so it needs to have the same attributes as the actual. -- so it needs to have the same attributes as the actual.
if Present (Actual_Subp) if Present (Actual_Subp)
and then Is_Dispatching_Operation (Parent_Subp) and then Is_Dispatching_Operation (Actual_Subp)
then then
Set_Is_Dispatching_Operation (New_Subp); Set_Is_Dispatching_Operation (New_Subp);
if Present (DTC_Entity (Parent_Subp)) then if Present (DTC_Entity (Actual_Subp)) then
Set_DTC_Entity (New_Subp, DTC_Entity (Parent_Subp)); Set_DTC_Entity (New_Subp, DTC_Entity (Actual_Subp));
Set_DT_Position (New_Subp, DT_Position (Parent_Subp)); Set_DT_Position (New_Subp, DT_Position (Actual_Subp));
end if; end if;
end if; end if;
......
...@@ -5965,6 +5965,29 @@ package body Sem_Util is ...@@ -5965,6 +5965,29 @@ package body Sem_Util is
return Name_Buffer (Name_Len) = Suffix; return Name_Buffer (Name_Len) = Suffix;
end Has_Suffix; end Has_Suffix;
----------------
-- Add_Suffix --
----------------
function Add_Suffix (E : Entity_Id; Suffix : Character) return Name_Id is
begin
Get_Name_String (Chars (E));
Add_Char_To_Name_Buffer (Suffix);
return Name_Find;
end Add_Suffix;
-------------------
-- Remove_Suffix --
-------------------
function Remove_Suffix (E : Entity_Id; Suffix : Character) return Name_Id is
begin
pragma Assert (Has_Suffix (E, Suffix));
Get_Name_String (Chars (E));
Name_Len := Name_Len - 1;
return Name_Find;
end Remove_Suffix;
-------------------------- --------------------------
-- Has_Tagged_Component -- -- Has_Tagged_Component --
-------------------------- --------------------------
......
...@@ -691,6 +691,12 @@ package Sem_Util is ...@@ -691,6 +691,12 @@ package Sem_Util is
function Has_Suffix (E : Entity_Id; Suffix : Character) return Boolean; function Has_Suffix (E : Entity_Id; Suffix : Character) return Boolean;
-- Returns true if the last character of E is Suffix. Used in Assertions. -- Returns true if the last character of E is Suffix. Used in Assertions.
function Add_Suffix (E : Entity_Id; Suffix : Character) return Name_Id;
-- Returns the name of E adding Suffix
function Remove_Suffix (E : Entity_Id; Suffix : Character) return Name_Id;
-- Returns the name of E without Suffix
function Has_Tagged_Component (Typ : Entity_Id) return Boolean; function Has_Tagged_Component (Typ : Entity_Id) return Boolean;
-- Returns True if Typ is a composite type (array or record) which is -- Returns True if Typ is a composite type (array or record) which is
-- either itself a tagged type, or has a component (recursively) which is -- either itself a tagged type, or has a component (recursively) which is
......
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