* [Ada] Simplify call to overloaded Earlier_In_Extended_Unit
@ 2022-05-10 8:21 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-10 8:21 UTC (permalink / raw)
To: gcc-patches; +Cc: Piotr Trojanek
[-- Attachment #1: Type: text/plain, Size: 388 bytes --]
We have two variants of Earlier_In_Extended_Unit that take either
Node_Id or Source_Ptr values. The caller can simply use another variant
and not explicitly convert parameters.
Code cleanup; semantics is unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_warn.adb (Check_Unset_Reference): Use variant of
Earlier_In_Extended_Unit that calls Sloc internally.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 614 bytes --]
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -1915,7 +1915,7 @@ package body Sem_Warn is
and then (No (Unset_Reference (E))
or else
Earlier_In_Extended_Unit
- (Sloc (N), Sloc (Unset_Reference (E))))
+ (N, Unset_Reference (E)))
and then not Has_Pragma_Unmodified_Check_Spec (E)
and then not Warnings_Off_Check_Spec (E)
and then not Has_Junk_Name (E)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-10 8:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 8:21 [Ada] Simplify call to overloaded Earlier_In_Extended_Unit 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).