aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.adb
diff options
context:
space:
mode:
authorRonan Desplanques <desplanques@adacore.com>2023-03-03 12:33:21 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-05-25 09:44:16 +0200
commit9df64b72bb887ca8802df1a2731403d219bebb5f (patch)
tree5f1b331b3afbe88123105082d628bdac83c35876 /gcc/ada/sem_ch3.adb
parentbc46312fe9088b16a39303db54d49b43165dec4b (diff)
downloadgcc-9df64b72bb887ca8802df1a2731403d219bebb5f.zip
gcc-9df64b72bb887ca8802df1a2731403d219bebb5f.tar.gz
gcc-9df64b72bb887ca8802df1a2731403d219bebb5f.tar.bz2
ada: Maximize use of existing constant
This patch does not change the behavior of the compiler and is intended as a readability improvement. gcc/ada/ * sem_ch3.adb (Replace_Type): Use existing constant wherever possible.
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r--gcc/ada/sem_ch3.adb4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index c8af679..0bddfa8 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -15994,7 +15994,7 @@ package body Sem_Ch3 is
-- of the parent, and we can also use it rather than its base,
-- which can lead to more efficient code.
- if Etype (Id) = Parent_Type then
+ if Id_Type = Parent_Type then
if Is_Scalar_Type (Parent_Type)
and then
Subtypes_Statically_Compatible (Parent_Type, Derived_Type)
@@ -16019,7 +16019,7 @@ package body Sem_Ch3 is
end if;
else
- Set_Etype (New_Id, Etype (Id));
+ Set_Etype (New_Id, Id_Type);
end if;
end Replace_Type;