This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Remove dead code from Enclosing_Package_Or_Subprogram routine


Calls to Scope always return unique entities, i.e. package/subprogram
and not their bodies, so there is no need to expect them.

Cleanup only; semantics unaffected. (This routine was only used in CCG
and GNATprove backends anyway.)

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

2019-07-08  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_util.adb (Enclosing_Package_Or_Subprogram): Do not expect
	package and subprogram bodies.
--- gcc/ada/sem_util.adb
+++ gcc/ada/sem_util.adb
@@ -6924,12 +6924,7 @@ package body Sem_Util is
       S := Scope (E);
       while Present (S) loop
          if Is_Package_Or_Generic_Package (S)
-           or else Ekind (S) = E_Package_Body
-         then
-            return S;
-
-         elsif Is_Subprogram_Or_Generic_Subprogram (S)
-           or else Ekind (S) = E_Subprogram_Body
+           or else Is_Subprogram_Or_Generic_Subprogram (S)
          then
             return S;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]