diff mbox series

[Ada] Remove dead code for detecting hidden package state

Message ID 20200602085939.GA119844@adacore.com
State New
Headers show
Series [Ada] Remove dead code for detecting hidden package state | expand

Commit Message

Pierre-Marie de Rodat June 2, 2020, 8:59 a.m. UTC
When climbing the chain of scopes (using Sinfo.Scope) we always process
unique entities, e.g. an E_Procedure even for entities that
syntactically reside in E_Subprogram_Body; same for tasks, entries and
packages. There is no need to expect E_Package_Body, because it never
occurs.

The removed dead code was only relevant to GNATprove; it doesn't affect
compilation.

Tested on x86_64-pc-linux-gnu, committed on trunk

2020-06-02  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_util.adb (Check_No_Hidden_State): Remove dead code.
diff mbox series

Patch

--- gcc/ada/sem_util.adb
+++ gcc/ada/sem_util.adb
@@ -3398,12 +3398,6 @@  package body Sem_Util is
            or else Ekind_In (Context, E_Block, E_Task_Type)
          then
             return;
-
-         --  When examining a package body, use the entity of the spec as it
-         --  carries the abstract state declarations.
-
-         elsif Ekind (Context) = E_Package_Body then
-            Context := Spec_Entity (Context);
          end if;
 
          --  Stop the traversal when a package subject to a null abstract state