diff options
author | Javier Miranda <miranda@adacore.com> | 2009-07-10 11:10:43 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-07-10 11:10:43 +0200 |
commit | c6ad817fc1467991bf8f4109bbc5fd6bf294eabf (patch) | |
tree | f0413a5127b01d679b986040d4b98f862f3ad1da /gcc | |
parent | 9d9dacaa9e0ea74d30aa2fe3227d7497d60f3176 (diff) | |
download | gcc-c6ad817fc1467991bf8f4109bbc5fd6bf294eabf.zip gcc-c6ad817fc1467991bf8f4109bbc5fd6bf294eabf.tar.gz gcc-c6ad817fc1467991bf8f4109bbc5fd6bf294eabf.tar.bz2 |
exp_util.adb (Find_Interface_Tag): Reorder processing of incoming Typ argument to ensure proper management of...
2009-07-10 Javier Miranda <miranda@adacore.com>
* exp_util.adb (Find_Interface_Tag): Reorder processing of incoming
Typ argument to ensure proper management of access types.
From-SVN: r149461
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/exp_util.adb | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index af7d0aa..97aa765 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -1600,28 +1600,24 @@ package body Exp_Util is begin pragma Assert (Is_Interface (Iface)); - -- Handle private types - - if Has_Private_Declaration (Typ) - and then Present (Full_View (Typ)) - then - Typ := Full_View (Typ); - end if; - -- Handle access types if Is_Access_Type (Typ) then Typ := Directly_Designated_Type (Typ); end if; - -- Handle task and protected types implementing interfaces + -- Handle class-wide types - if Is_Concurrent_Type (Typ) then - Typ := Corresponding_Record_Type (Typ); + if Is_Class_Wide_Type (Typ) then + Typ := Root_Type (Typ); end if; - if Is_Class_Wide_Type (Typ) then - Typ := Etype (Typ); + -- Handle private types + + if Has_Private_Declaration (Typ) + and then Present (Full_View (Typ)) + then + Typ := Full_View (Typ); end if; -- Handle entities from the limited view @@ -1631,6 +1627,12 @@ package body Exp_Util is Typ := Non_Limited_View (Typ); end if; + -- Handle task and protected types implementing interfaces + + if Is_Concurrent_Type (Typ) then + Typ := Corresponding_Record_Type (Typ); + end if; + Find_Tag (Typ); pragma Assert (Found); return AI_Tag; |