From: Javier Miranda Date: Fri, 10 Jul 2009 09:10:43 +0000 (+0200) Subject: exp_util.adb (Find_Interface_Tag): Reorder processing of incoming Typ argument to... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c6ad817fc1467991bf8f4109bbc5fd6bf294eabf;p=gcc.git exp_util.adb (Find_Interface_Tag): Reorder processing of incoming Typ argument to ensure proper management of... 2009-07-10 Javier Miranda * exp_util.adb (Find_Interface_Tag): Reorder processing of incoming Typ argument to ensure proper management of access types. From-SVN: r149461 --- diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index af7d0aa0d2d..97aa7655330 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;