]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Cleanup redundant condition in resolution of entity names
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 6 Feb 2023 21:56:49 +0000 (22:56 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 22 May 2023 08:44:10 +0000 (10:44 +0200)
Code cleanup related to new contract for SPARK; semantics is unaffected.

gcc/ada/

* sem_res.adb (Resolve_Entity_Name): Combine two IF statements that
execute code only for references that come from source.

gcc/ada/sem_res.adb

index 3eb13de38dff03cbf1af17f765f977cd94801d39..365c75041a941b3d92540aee59ad6b7df21b258d 100644 (file)
@@ -8022,7 +8022,7 @@ package body Sem_Res is
 
       if Comes_From_Source (N) then
 
-         --  The following checks are only relevant when SPARK_Mode is on as
+         --  The following checks are only relevant when SPARK_Mode is On as
          --  they are not standard Ada legality rules.
 
          if SPARK_Mode = On then
@@ -8067,13 +8067,11 @@ package body Sem_Res is
          if Is_Ghost_Entity (E) then
             Check_Ghost_Context (E, N);
          end if;
-      end if;
 
-      --  We may be resolving an entity within expanded code, so a reference to
-      --  an entity should be ignored when calculating effective use clauses to
-      --  avoid inappropriate marking.
+         --  We may be resolving an entity within expanded code, so a reference
+         --  to an entity should be ignored when calculating effective use
+         --  clauses to avoid inappropriate marking.
 
-      if Comes_From_Source (N) then
          Mark_Use_Clauses (E);
       end if;
    end Resolve_Entity_Name;