aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-04-06 13:10:01 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2021-06-29 14:23:47 +0000
commit32638d4975f2768b25732f87b4708360117ef0fd (patch)
tree4216b51e8b778cc3a4083cf510d36dfa80693b1f
parent4c07e6d67921bb0793890550094d464153e479eb (diff)
downloadgcc-32638d4975f2768b25732f87b4708360117ef0fd.zip
gcc-32638d4975f2768b25732f87b4708360117ef0fd.tar.gz
gcc-32638d4975f2768b25732f87b4708360117ef0fd.tar.bz2
[Ada] Simplify detection of local types
gcc/ada/ * sem_ch3.adb (Is_Local_Type): Simplify by reusing Scope_Within.
-rw-r--r--gcc/ada/sem_ch3.adb15
1 files changed, 1 insertions, 14 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 98cbef4..70e1dfd 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