* [Ada] Small performance tweak in recent change
@ 2022-05-18 8:42 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-18 8:42 UTC (permalink / raw)
To: gcc-patches; +Cc: Eric Botcazou
[-- Attachment #1: Type: text/plain, Size: 220 bytes --]
This avoids a useless walk of the prefix chain in instances.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_ch8.adb (Analyze_Subprogram_Renaming): Move final test on
In_Instance to outer condition.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 826 bytes --]
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -3975,7 +3975,7 @@ package body Sem_Ch8 is
-- normally illegal renamings can be constructed when expanding
-- instantiations.
- elsif Nkind (Nam) = N_Expanded_Name then
+ elsif Nkind (Nam) = N_Expanded_Name and then not In_Instance then
declare
function Ult_Expanded_Prefix (N : Node_Id) return Node_Id is
(if Nkind (N) /= N_Expanded_Name
@@ -3985,7 +3985,6 @@ package body Sem_Ch8 is
begin
if Chars (Entity (Ult_Expanded_Prefix (Nam))) = Chars (New_S)
- and then not In_Instance
then
Error_Msg_Sloc := Sloc (N);
Error_Msg_NE
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-18 8:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-18 8:42 [Ada] Small performance tweak in recent change 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).