public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-3669] ada: Simplify detection of controlling formals
@ 2022-11-04 13:54 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2022-11-04 13:54 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:50bd9f4e6fc7ac84b5d0f29b76dff1f82381ee38

commit r13-3669-g50bd9f4e6fc7ac84b5d0f29b76dff1f82381ee38
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Fri Oct 7 21:58:58 2022 +0200

    ada: Simplify detection of controlling formals
    
    When detecting controlling formals we are only interested in formal
    parameters and not in other entities.
    
    gcc/ada/
    
            * sem_ch6.adb (Controlling_Formal): Iterate with First/Next_Formal
            and not with First/Next_Entity.

Diff:
---
 gcc/ada/sem_ch6.adb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 228adcff5cd..d28de10d3d6 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -10711,13 +10711,13 @@ package body Sem_Ch6 is
          E : Entity_Id;
 
       begin
-         E := First_Entity (Prim);
+         E := First_Formal (Prim);
          while Present (E) loop
-            if Is_Formal (E) and then Is_Controlling_Formal (E) then
+            if Is_Controlling_Formal (E) then
                return E;
             end if;
 
-            Next_Entity (E);
+            Next_Formal (E);
          end loop;
 
          return Empty;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-04 13:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-04 13:54 [gcc r13-3669] ada: Simplify detection of controlling formals Marc Poulhi?s

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).