aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-01-20 22:37:30 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-10 08:19:26 +0000
commit8cec0688df7258e16b7c9d2614e16b5b9346da1d (patch)
tree74b81085d300d32136e371bb188a66efb9ffe89c
parentea22ec90df9649465b172269027fff8f0750047b (diff)
downloadgcc-8cec0688df7258e16b7c9d2614e16b5b9346da1d.zip
gcc-8cec0688df7258e16b7c9d2614e16b5b9346da1d.tar.gz
gcc-8cec0688df7258e16b7c9d2614e16b5b9346da1d.tar.bz2
[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.
-rw-r--r--gcc/ada/sem_warn.adb9
1 files changed, 0 insertions, 9 deletions
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index 8ca5c76..31ba4d1 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).