summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch3.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-03 10:55:53 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-03 10:55:53 +0000
commit6f2b011d9c7017ba798c7d120cb10f4af9072b9d (patch)
treeba4ad934659d79b98c1bc07a1b32e67120d5abf8 /gcc/ada/exp_ch3.adb
parent25d7574bcf57e89237f41bcf625de9328730ba44 (diff)
downloadgcc-6f2b011d9c7017ba798c7d120cb10f4af9072b9d.tar.gz
2013-01-03 Robert Dewar <dewar@adacore.com>
* sem_ch8.adb, einfo.ads, einfo.adb: Minor code reorganization. 2013-01-03 Javier Miranda <miranda@adacore.com> * exp_ch3.adb (Make_Controlling_Function_Wrappers): Exclude internal entities associated with interfaces and add minimum decoration to the defining entity of the generated wrapper to allow overriding interface primitives. * sem_disp.ads (Override_Dispatching_Operation): Addition of a new formal (Is_Wrapper). * sem_disp.adb (Override_Dispatching_Operation): When overriding interface primitives the new formal helps identifying that the new operation is not fully decorated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194846 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch3.adb')
-rw-r--r--gcc/ada/exp_ch3.adb16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 83d0c004854..15d5de0bd20 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -8274,7 +8274,10 @@ package body Exp_Ch3 is
-- Input attributes, since each type will have its own version of
-- Input constructed by the expander. The test for Comes_From_Source
-- is needed to distinguish inherited operations from renamings
- -- (which also have Alias set).
+ -- (which also have Alias set). We exclude internal entities with
+ -- Interface_Alias to avoid generating duplicated wrappers since
+ -- the primitive which covers the interface is also available in
+ -- the list of primitive operations.
-- The function may be abstract, or require_Overriding may be set
-- for it, because tests for null extensions may already have reset
@@ -8284,6 +8287,7 @@ package body Exp_Ch3 is
if Comes_From_Source (Subp)
or else No (Alias (Subp))
+ or else Present (Interface_Alias (Subp))
or else Ekind (Subp) /= E_Function
or else not Has_Controlling_Result (Subp)
or else Is_Access_Type (Etype (Subp))
@@ -8400,11 +8404,15 @@ package body Exp_Ch3 is
Append_To (Body_List, Func_Body);
- -- Replace the inherited function with the wrapper function
- -- in the primitive operations list.
+ -- Replace the inherited function with the wrapper function in the
+ -- primitive operations list. We add the minimum decoration needed
+ -- to override interface primitives.
+
+ Set_Ekind (Defining_Unit_Name (Func_Spec), E_Function);
Override_Dispatching_Operation
- (Tag_Typ, Subp, New_Op => Defining_Unit_Name (Func_Spec));
+ (Tag_Typ, Subp, New_Op => Defining_Unit_Name (Func_Spec),
+ Is_Wrapper => True);
end if;
<<Next_Prim>>