public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-585] [Ada] Small performance tweak in recent change Date: Wed, 18 May 2022 08:42:56 +0000 (GMT) [thread overview] Message-ID: <20220518084256.8AB22385780C@sourceware.org> (raw) https://gcc.gnu.org/g:700cd7d6733e62e5ad8212cb6c51866679173b41 commit r13-585-g700cd7d6733e62e5ad8212cb6c51866679173b41 Author: Eric Botcazou <ebotcazou@adacore.com> Date: Wed Mar 30 12:59:23 2022 +0200 [Ada] Small performance tweak in recent change This avoids a useless walk of the prefix chain in instances. gcc/ada/ * sem_ch8.adb (Analyze_Subprogram_Renaming): Move final test on In_Instance to outer condition. Diff: --- gcc/ada/sem_ch8.adb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 1cf34117a30..5945bfdf90d 100644 --- 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
reply other threads:[~2022-05-18 8:42 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220518084256.8AB22385780C@sourceware.org \ --to=pmderodat@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).