[COMMITTED] ada: Get name from entity if that's what's passed to Subprogram_Name

Message ID 20230516084011.1501341-1-poulhies@adacore.com
State Accepted
Headers
Series [COMMITTED] ada: Get name from entity if that's what's passed to Subprogram_Name |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Marc Poulhiès May 16, 2023, 8:40 a.m. UTC
  From: Richard Kenner <kenner@adacore.com>

gcc/ada/

	* sem_util.adb (Subprogram_Name): If what's passed is already an
	entity, use that for the name.

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

---
 gcc/ada/sem_util.adb | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index eb0d08a1851..8bce0229867 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -28095,6 +28095,9 @@  package body Sem_Util is
                Ent := Defining_Identifier (Ent);
                exit;
 
+            when N_Entity =>
+               exit;
+
             when others =>
                null;
          end case;