From 42959b0c5aa6a3ff084de4b27f4b3830c417697f Mon Sep 17 00:00:00 2001 From: Robert Dewar Date: Mon, 27 Jan 2014 16:27:02 +0000 Subject: gnat_ugn.texi: Add Short_Enums to documentation of -gnatet/-gnateT. 2014-01-27 Robert Dewar * gnat_ugn.texi: Add Short_Enums to documentation of -gnatet/-gnateT. 2014-01-27 Robert Dewar * sem_prag.adb (Analyze_Input_Item): Correct check for input item in same package. * sem_util.ads, sem_util.adb (Within_Scope): New function. From-SVN: r207134 --- gcc/ada/sem_util.adb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gcc/ada/sem_util.adb') diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index cf00b2f..9c9a227 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -16100,6 +16100,25 @@ package body Sem_Util is return Is_Init_Proc (S); end Within_Init_Proc; + ------------------ + -- Within_Scope -- + ------------------ + + function Within_Scope (E : Entity_Id; S : Entity_Id) return Boolean is + SE : Entity_Id; + begin + SE := Scope (E); + loop + if SE = S then + return True; + elsif SE = Standard_Standard then + return False; + else + SE := Scope (SE); + end if; + end loop; + end Within_Scope; + ---------------- -- Wrong_Type -- ---------------- -- cgit v1.1