From 4fe5bbcf30a491a1722fa1752bc0ea9c32dcb2e3 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Mon, 8 Jul 2019 08:14:46 +0000 Subject: [PATCH] [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.) 2019-07-08 Piotr Trojanek gcc/ada/ * sem_util.adb (Enclosing_Package_Or_Subprogram): Do not expect package and subprogram bodies. From-SVN: r273222 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/sem_util.adb | 7 +------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7641688ec7d..d38dce0f9eb 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-07-08 Piotr Trojanek + + * sem_util.adb (Enclosing_Package_Or_Subprogram): Do not expect + package and subprogram bodies. + 2019-07-08 Bob Duff * doc/gnat_ugn/gnat_utility_programs.rst: Remove documentation diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 67bc4de39c4..0d4ec9cebf1 100644 --- a/gcc/ada/sem_util.adb +++ b/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; -- 2.30.2