From: Piotr Trojanek Date: Thu, 20 Jan 2022 21:37:30 +0000 (+0100) Subject: [Ada] Remove tiny and incomplete optimization for unset references X-Git-Tag: basepoints/gcc-14~6965 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8cec0688df7258e16b7c9d2614e16b5b9346da1d;p=thirdparty%2Fgcc.git [Ada] Remove tiny and incomplete optimization for unset references Code cleanup; behaviour is unaffected. gcc/ada/ * sem_warn.adb (Check_Unset_Reference): The early test was only saving time of calls to Original_Node, Comes_From_Source and Nkind, which are all quick and cheap. --- diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 8ca5c76a075..31ba4d1e903 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -1882,15 +1882,6 @@ package body Sem_Warn is return; end if; - -- Nothing to do for numeric or string literal. Do this test early to - -- save time in a common case (it does not matter that we do not include - -- character literal here, since that will be caught later on in the - -- when others branch of the case statement). - - if Nkind (N) in N_Numeric_Or_String_Literal then - return; - end if; - -- Ignore reference unless it comes from source. Almost always if we -- have a reference from generated code, it is bogus (e.g. calls to init -- procs to set default discriminant values).