aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2023-09-26 00:17:26 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-11-07 10:15:01 +0100
commit98787e9cdd6346486d1f69a67c8bdb71aeded74b (patch)
tree63aab4e7cb97a14be0f8fc7b180947c2c10dbd73 /gcc
parentb618441a25a5ab963f26a8415eb43c87cfcf6505 (diff)
downloadgcc-98787e9cdd6346486d1f69a67c8bdb71aeded74b.zip
gcc-98787e9cdd6346486d1f69a67c8bdb71aeded74b.tar.gz
gcc-98787e9cdd6346486d1f69a67c8bdb71aeded74b.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_util.adb4
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index da531e5..d5df05b 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;