aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-01-07 12:17:49 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2021-05-04 05:17:34 -0400
commitd20bab53d067fbcb028acaf0e7cbb97d2cd18acc (patch)
treeb05fc4bc7271965cd7a1c1ebd1ac17dd06ec2d2c
parent86203b44de9b6a3394816207728155164ea2caa0 (diff)
downloadgcc-d20bab53d067fbcb028acaf0e7cbb97d2cd18acc.zip
gcc-d20bab53d067fbcb028acaf0e7cbb97d2cd18acc.tar.gz
gcc-d20bab53d067fbcb028acaf0e7cbb97d2cd18acc.tar.bz2
[Ada] Reuse First_Formal for generic subprograms
gcc/ada/ * lib-xref.adb (Generate_Reference_To_Formals): Remove dedicated branch for generic subprograms (they are now handled together with non-generic subprograms in the ELSE branch); replace a low-level Ekind membership test with a high-level call to Is_Access_Subprogram_Type.
-rw-r--r--gcc/ada/lib-xref.adb12
1 files changed, 1 insertions, 11 deletions
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index 1b0b177..f8d86e6 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -1277,18 +1277,8 @@ package body Lib.Xref is
Formal : Entity_Id;
begin
- if Is_Generic_Subprogram (E) then
- Formal := First_Entity (E);
-
- while Present (Formal)
- and then not Is_Formal (Formal)
- loop
- Next_Entity (Formal);
- end loop;
-
- elsif Ekind (E) in Access_Subprogram_Kind then
+ if Is_Access_Subprogram_Type (E) then
Formal := First_Formal (Designated_Type (E));
-
else
Formal := First_Formal (E);
end if;