From: Piotr Trojanek <[email protected]>

Code cleanup; semantics is unaffected.

gcc/ada/ChangeLog:

        * sem_ch13.adb (Rep_Item_Too_Late): Simplify with membership test.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/sem_ch13.adb | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 43120d79400..722999da459 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -16976,16 +16976,15 @@ package body Sem_Ch13 is
       --  but avoid chaining if we have an overloadable entity, and the pragma
       --  is one that can apply to multiple overloaded entities.
 
-      if Is_Overloadable (T) and then Nkind (N) = N_Pragma then
-         declare
-            Pname : constant Name_Id := Pragma_Name (N);
-         begin
-            if Pname in Name_Convention | Name_Import | Name_Export
-                      | Name_External   | Name_Interface
-            then
-               return False;
-            end if;
-         end;
+      if Is_Overloadable (T)
+        and then Nkind (N) = N_Pragma
+        and then Pragma_Name (N) in Name_Convention
+                                  | Name_Import
+                                  | Name_Export
+                                  | Name_External
+                                  | Name_Interface
+      then
+         return False;
       end if;
 
       Record_Rep_Item (T, N);
-- 
2.53.0

Reply via email to