summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_disp.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-06 10:08:52 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-06 10:08:52 +0000
commit827deff36ff5422291fde9612aebbe12d40e93d4 (patch)
tree51e2e860329d34928673ca83071088b08eca2e1b /gcc/ada/exp_disp.adb
parent9300973d427eedf542c06dc7883ef10af69984a0 (diff)
downloadgcc-827deff36ff5422291fde9612aebbe12d40e93d4.tar.gz
2015-01-06 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Has_Independent_Components): Document extended usage. * einfo.adb (Has_Independent_Components): Remove obsolete assertion. (Set_Has_Independent_Components): Adjust assertion. * sem_prag.adb (Analyze_Pragma): Also set Has_Independent_Components for pragma Atomic_Components. Set Has_Independent_Components on the object instead of the type for an object declaration with pragma Independent_Components. 2015-01-06 Olivier Hainque <hainque@adacore.com> * set_targ.adb (Read_Target_Dependent_Values): Set Long_Double_Index when "long double" is read. (elaboration code): Register_Back_End_Types only when not reading from config files. Doing otherwise is pointless and error prone. 2015-01-06 Robert Dewar <dewar@adacore.com> * s-valrea.adb (Value_Real): Check for Str'Last = Positive'Last 2015-01-06 Robert Dewar <dewar@adacore.com> * a-wtgeau.adb, a-ztgeau.adb, a-tigeau.adb (String_Skip): Raise PE if Str'Last = Positive'Last. 2015-01-06 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Matches_Limited_View): Handle properly the case where the non-limited type is a generic actual and appears as a subtype of the non-limited view of the other. * freeze.adb (Build_Renamed_Body): If the return type of the declaration that is being completed is a limited view and the non-limited view is available, use it in the specification of the generated body. 2015-01-06 Javier Miranda <miranda@adacore.com> * exp_disp.adb: Reapplying reversed patch. 2015-01-06 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Find_Type_Name): If there is a previous tagged incomplete view, the type of the classwide type common to both views is the type being declared. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219247 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_disp.adb')
-rw-r--r--gcc/ada/exp_disp.adb19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb
index 99105e0ea4f..905311b6eb9 100644
--- a/gcc/ada/exp_disp.adb
+++ b/gcc/ada/exp_disp.adb
@@ -1138,6 +1138,25 @@ package body Exp_Disp is
Operand_Typ := Base_Type (Corresponding_Record_Type (Operand_Typ));
end if;
+ -- No displacement of the pointer to the object needed when the type of
+ -- the operand is not an interface type and the interface is one of
+ -- its parent types (since they share the primary dispatch table).
+
+ declare
+ Opnd : Entity_Id := Operand_Typ;
+
+ begin
+ if Is_Access_Type (Opnd) then
+ Opnd := Designated_Type (Opnd);
+ end if;
+
+ if not Is_Interface (Opnd)
+ and then Is_Ancestor (Iface_Typ, Opnd, Use_Full_View => True)
+ then
+ return;
+ end if;
+ end;
+
-- Evaluate if we can statically displace the pointer to the object
declare