aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch4.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-06-24 11:19:41 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-06-24 11:19:41 +0200
commit852dba8059832d76c74e1e6f31d65a9302a0baa7 (patch)
tree74771738dd04024246ed48f56765e4d1a4f1bca8 /gcc/ada/exp_ch4.adb
parent950d217a1ce57c2d8cdc4b54f73515409a0dbf18 (diff)
downloadgcc-852dba8059832d76c74e1e6f31d65a9302a0baa7.zip
gcc-852dba8059832d76c74e1e6f31d65a9302a0baa7.tar.gz
gcc-852dba8059832d76c74e1e6f31d65a9302a0baa7.tar.bz2
[multiple changes]
2009-06-24 Javier Miranda <miranda@adacore.com> * exp_ch4.adb (Expand_N_Type_Conversion): Handle entities that are visible through limited-with context clauses. In addition, avoid an extra tag check that is not required when the class-wide designated types of the operand and target types are the same entity. (Tagged_Membership): Handle entities from the limited view. 2009-06-24 Emmanuel Briot <briot@adacore.com> * gnatcmd.adb, make.adb, mlib-prj.adb, prj.ads, clean.adb, prj-nmsc.adb, prj-env.adb (File_Name_Data): removed (Spec_Or_Body): now a subtype of Source_Kind, to avoid using two different vocabularies for similar concepts (Impl/Body_Part and Spec/Specification). (Unit_Data): now points directly to a Source_Id, rather than duplicating some of the information in File_Name_Data. This also saves a bit of memory. However, since we are now using a pointer we need to test for null explicitly in several places of the code From-SVN: r148900
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r--gcc/ada/exp_ch4.adb15
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 1862cb5..9c124ad 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -7955,9 +7955,13 @@ package body Exp_Ch4 is
begin
if Is_Access_Type (Target_Type) then
- Actual_Op_Typ := Designated_Type (Operand_Type);
- Actual_Targ_Typ := Designated_Type (Target_Type);
+ -- Handle entities from the limited view
+
+ Actual_Op_Typ :=
+ Available_View (Designated_Type (Operand_Type));
+ Actual_Targ_Typ :=
+ Available_View (Designated_Type (Target_Type));
else
Actual_Op_Typ := Operand_Type;
Actual_Targ_Typ := Target_Type;
@@ -7978,6 +7982,7 @@ package body Exp_Ch4 is
-- conversion.
if Is_Class_Wide_Type (Actual_Op_Typ)
+ and then Actual_Op_Typ /= Actual_Targ_Typ
and then Root_Op_Typ /= Actual_Targ_Typ
and then Is_Ancestor (Root_Op_Typ, Actual_Targ_Typ)
then
@@ -9486,8 +9491,10 @@ package body Exp_Ch4 is
Obj_Tag : Node_Id;
begin
- Left_Type := Etype (Left);
- Right_Type := Etype (Right);
+ -- Handle entities from the limited view
+
+ Left_Type := Available_View (Etype (Left));
+ Right_Type := Available_View (Etype (Right));
if Is_Class_Wide_Type (Left_Type) then
Left_Type := Root_Type (Left_Type);