From: Piotr Trojanek Date: Mon, 25 Sep 2023 22:17:26 +0000 (+0200) Subject: ada: Cleanup getting of actual subtypes X-Git-Tag: basepoints/gcc-15~4949 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98787e9cdd6346486d1f69a67c8bdb71aeded74b;p=thirdparty%2Fgcc.git ada: Cleanup getting of actual subtypes Avoid potentially unnecessary call to Etype. gcc/ada/ * sem_util.adb (Get_Actual_Subtype_If_Available): Only call Etype when necessary. --- diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index da531e53466c..d5df05b88e12 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -10218,8 +10218,6 @@ package body Sem_Util is ------------------------------------- function Get_Actual_Subtype_If_Available (N : Node_Id) return Entity_Id is - Typ : constant Entity_Id := Etype (N); - begin -- If what we have is an identifier that references a subprogram -- formal, or a variable or constant object, then we get the actual @@ -10245,7 +10243,7 @@ package body Sem_Util is -- Otherwise the Etype of N is returned unchanged else - return Typ; + return Etype (N); end if; end Get_Actual_Subtype_If_Available;