public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1886] [Ada] Simplify detection of local types
@ 2021-06-29 14:25 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-06-29 14:25 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:32638d4975f2768b25732f87b4708360117ef0fd
commit r12-1886-g32638d4975f2768b25732f87b4708360117ef0fd
Author: Piotr Trojanek <trojanek@adacore.com>
Date: Tue Apr 6 13:10:01 2021 +0200
[Ada] Simplify detection of local types
gcc/ada/
* sem_ch3.adb (Is_Local_Type): Simplify by reusing Scope_Within.
Diff:
---
gcc/ada/sem_ch3.adb | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 98cbef483db..70e1dfdb71d 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -19133,21 +19133,8 @@ package body Sem_Ch3 is
-------------------
function Is_Local_Type (Typ : Entity_Id) return Boolean is
- Scop : Entity_Id;
-
begin
- Scop := Scope (Typ);
- while Present (Scop)
- and then Scop /= Standard_Standard
- loop
- if Scop = Scope (Current_Scope) then
- return True;
- end if;
-
- Scop := Scope (Scop);
- end loop;
-
- return False;
+ return Scope_Within (Inner => Typ, Outer => Scope (Current_Scope));
end Is_Local_Type;
-- Start of processing for Is_Visible_Component
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-29 14:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29 14:25 [gcc r12-1886] [Ada] Simplify detection of local types Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).