From: Thomas Schwinge <thomas@codesourcery.com>
To: Martin Sebor <msebor@gmail.com>, <gcc-patches@gcc.gnu.org>
Subject: [ping] Use 'location_hash' for 'gcc/diagnostic-spec.h:nowarn_map'
Date: Mon, 15 Nov 2021 16:01:01 +0100 [thread overview]
Message-ID: <87pmr1jweq.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <87a6id76pn.fsf@euler.schwinge.homeip.net>
[-- Attachment #1: Type: text/plain, Size: 1269 bytes --]
Hi!
Ping.
Grüße
Thomas
On 2021-11-09T15:18:44+0100, I wrote:
> Hi!
>
> On 2021-09-03T21:16:46+0200, I wrote:
>> On 2021-09-01T18:14:46-0600, Martin Sebor <msebor@gmail.com> wrote:
>>> On 9/1/21 1:35 PM, Thomas Schwinge wrote:
>>>> On 2021-06-23T13:47:08-0600, Martin Sebor via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>>>>> --- /dev/null
>>>>> +++ b/gcc/diagnostic-spec.h
>>>>
>>>>> +typedef location_t key_type_t;
>>>>> +typedef int_hash <key_type_t, 0, UINT_MAX> xint_hash_t;
>>
>>> By the way, it seems we should probably also use a manifest constant
>>> for Empty (probably UNKNOWN_LOCATION since we're reserving it).
>>
>> Yes, that will be part of another patch here -- waiting for approval of
>> "Generalize 'gcc/input.h:struct location_hash'" posted elsewhere.
>
> ... which I have now pushed, so I may now propose the attached patch to
> "Use 'location_hash' for 'gcc/diagnostic-spec.h:nowarn_map'". OK to
> push?
>
>
> Grüße
> Thomas
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-location_hash-for-gcc-diagnostic-spec.h-nowarn_m.patch --]
[-- Type: text/x-diff, Size: 2379 bytes --]
From d346292fc95f1990abbc9f6a4a8eb89be0f0e88d Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Tue, 31 Aug 2021 23:35:15 +0200
Subject: [PATCH] Use 'location_hash' for 'gcc/diagnostic-spec.h:nowarn_map'
Instead of hard-coded '0'/'UINT_MAX', we now use the 'RESERVED_LOCATION_P'
values 'UNKNOWN_LOCATION'/'BUILTINS_LOCATION' as spare values for
'Empty'/'Deleted', and generally simplify the code.
gcc/
* diagnostic-spec.h (typedef xint_hash_t)
(typedef xint_hash_map_t): Replace with...
(typedef nowarn_map_t): ... this.
(nowarn_map): Adjust.
* diagnostic-spec.c (nowarn_map, suppress_warning_at): Likewise.
---
gcc/diagnostic-spec.c | 4 ++--
gcc/diagnostic-spec.h | 9 ++-------
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/gcc/diagnostic-spec.c b/gcc/diagnostic-spec.c
index 85ffb725c02..d1e563d19ba 100644
--- a/gcc/diagnostic-spec.c
+++ b/gcc/diagnostic-spec.c
@@ -107,7 +107,7 @@ nowarn_spec_t::nowarn_spec_t (opt_code opt)
/* A mapping from a 'location_t' to the warning spec set for it. */
-GTY(()) xint_hash_map_t *nowarn_map;
+GTY(()) nowarn_map_t *nowarn_map;
/* Return the no-warning disposition for location LOC and option OPT
or for all/any otions by default. */
@@ -163,7 +163,7 @@ suppress_warning_at (location_t loc, opt_code opt /* = all_warnings */,
return false;
if (!nowarn_map)
- nowarn_map = xint_hash_map_t::create_ggc (32);
+ nowarn_map = nowarn_map_t::create_ggc (32);
nowarn_map->put (loc, optspec);
return true;
diff --git a/gcc/diagnostic-spec.h b/gcc/diagnostic-spec.h
index e54e9e3ddbe..368b75f3254 100644
--- a/gcc/diagnostic-spec.h
+++ b/gcc/diagnostic-spec.h
@@ -130,14 +130,9 @@ operator!= (const nowarn_spec_t &lhs, const nowarn_spec_t &rhs)
return !(lhs == rhs);
}
-/* Per PR103157 "'gengtype': 'typedef' causing infinite-recursion code to be
- generated", don't use
- typedef int_hash<location_t, 0, UINT_MAX> xint_hash_t;
- here. */
-struct xint_hash_t : int_hash<location_t, 0, UINT_MAX> {};
-typedef hash_map<xint_hash_t, nowarn_spec_t> xint_hash_map_t;
+typedef hash_map<location_hash, nowarn_spec_t> nowarn_map_t;
/* A mapping from a 'location_t' to the warning spec set for it. */
-extern GTY(()) xint_hash_map_t *nowarn_map;
+extern GTY(()) nowarn_map_t *nowarn_map;
#endif // DIAGNOSTIC_SPEC_H_INCLUDED
--
2.33.0
next prev parent reply other threads:[~2021-11-15 15:01 UTC|newest]
Thread overview: 98+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-24 22:02 [PATCH 0/11] warning control by group and location (PR 74765) Martin Sebor
2021-05-24 22:07 ` [PATCH 1/11] introduce xxx_no_warning APIs Martin Sebor
2021-05-24 22:09 ` [PATCH 2/11] use xxx_no_warning APIs in Ada Martin Sebor
2021-05-25 8:59 ` Eric Botcazou
2021-05-27 20:29 ` Martin Sebor
2021-05-24 22:10 ` [PATCH 3/11] use xxx_no_warning APIs in C Martin Sebor
2021-05-24 22:11 ` [PATCH 4/11] use xxx_no_warning APIs in C family Martin Sebor
2021-05-24 22:11 ` [PATCH 5/11] use xxx_no_warning APIs in C++ Martin Sebor
2021-05-24 22:12 ` [PATCH 6/11] use xxx_no_warning APIs in Fortran Martin Sebor
2021-05-24 22:13 ` [PATCH 7/11] " Martin Sebor
2021-05-24 22:14 ` [PATCH 8/11] use xxx_no_warning APIs in Objective-C Martin Sebor
2021-05-25 14:01 ` Iain Sandoe
2021-05-25 15:48 ` Martin Sebor
2021-05-25 15:56 ` Iain Sandoe
2021-05-24 22:15 ` [PATCH 9/11] use xxx_no_warning APIs in rl78 back end Martin Sebor
2021-05-24 22:16 ` [PATCH 10/11] use xxx_no_warning APIs in libcc1 Martin Sebor
2021-05-24 22:16 ` [PATCH 11/11] use xxx_no_warning APIs in the middle end Martin Sebor
2021-05-24 23:08 ` David Malcolm
2021-05-25 0:44 ` Martin Sebor
2021-05-24 23:08 ` [PATCH 0/11] warning control by group and location (PR 74765) David Malcolm
2021-05-25 0:42 ` Martin Sebor
2021-05-25 9:04 ` Richard Biener
2021-05-25 20:50 ` Martin Sebor
2021-05-27 11:19 ` Richard Sandiford
2021-05-27 16:41 ` Martin Sebor
2021-05-27 21:55 ` David Malcolm
2021-05-28 4:40 ` Jason Merrill
2021-06-04 21:27 ` [PATCH 0/13] v2 " Martin Sebor
2021-06-04 21:41 ` [PATCH 1/13] v2 [PATCH 1/13] Add support for per-location warning groups " Martin Sebor
2021-06-21 21:34 ` [PING][PATCH " Martin Sebor
2021-06-22 23:18 ` [PATCH " David Malcolm
2021-06-22 23:28 ` David Malcolm
2021-06-23 19:47 ` Martin Sebor
2021-06-24 5:26 ` Jeff Law
2021-06-25 1:34 ` Martin Sebor
2021-09-01 19:35 ` Thomas Schwinge
2021-09-02 0:14 ` Martin Sebor
2021-09-03 19:16 ` Thomas Schwinge
2021-09-10 7:45 ` [PING] Don't maintain a warning spec for 'UNKNOWN_LOCATION'/'BUILTINS_LOCATION' [PR101574] (was: [PATCH 1/13] v2 [PATCH 1/13] Add support for per-location warning groups (PR 74765)) Thomas Schwinge
2021-09-13 14:00 ` Jeff Law
2021-11-09 14:18 ` Use 'location_hash' for 'gcc/diagnostic-spec.h:nowarn_map' " Thomas Schwinge
2021-11-15 15:01 ` Thomas Schwinge [this message]
2021-11-15 16:43 ` [ping] Use 'location_hash' for 'gcc/diagnostic-spec.h:nowarn_map' Martin Sebor
2021-11-09 10:28 ` Get rid of infinite recursion for 'typedef' used with GTY-marked 'gcc/diagnostic-spec.h:nowarn_map' [PR101204] (was: [PATCH 1/13] v2 [PATCH 1/13] Add support for per-location warning groups (PR 74765)) Thomas Schwinge
2021-11-09 10:54 ` Richard Biener
2021-11-09 12:25 ` Get rid of infinite recursion for 'typedef' used with GTY-marked 'gcc/diagnostic-spec.h:nowarn_map' [PR101204, PR103157] Thomas Schwinge
2021-11-10 4:52 ` Get rid of infinite recursion for 'typedef' used with GTY-marked 'gcc/diagnostic-spec.h:nowarn_map' [PR101204] Martin Sebor
2021-11-24 10:28 ` 'gengtype' (was: Get rid of infinite recursion for 'typedef' used with GTY-marked 'gcc/diagnostic-spec.h:nowarn_map' [PR101204]) Thomas Schwinge
2021-06-04 21:41 ` [PATCH 2/13] v2 Use new per-location warning APIs in Ada Martin Sebor
2021-06-24 5:07 ` Jeff Law
2021-06-28 21:20 ` Martin Sebor
2021-06-04 21:41 ` [PATCH 3/13] v2 Use new per-location warning APIs in C front end Martin Sebor
2021-06-21 21:35 ` [PING][PATCH " Martin Sebor
2021-06-24 5:09 ` [PATCH " Jeff Law
2021-06-25 1:35 ` Martin Sebor
2021-06-04 21:42 ` [PATCH 4/13] v2 Use new per-location warning APIs in C family code Martin Sebor
2021-06-21 21:35 ` [PING][PATCH " Martin Sebor
2021-06-24 5:06 ` [PATCH " Jeff Law
2021-06-25 1:36 ` Martin Sebor
2021-06-04 21:42 ` [PATCH 5/13] v2 Use new per-location warning APIs in the RL78 back end Martin Sebor
2021-06-24 5:06 ` Jeff Law
2021-06-04 21:42 ` [PATCH 6/13] v2 Use new per-location warning APIs in the C++ front end Martin Sebor
2021-06-21 21:37 ` [PING][PATCH " Martin Sebor
2021-06-24 5:12 ` [PATCH " Jeff Law
2021-06-25 1:38 ` Martin Sebor
2021-06-04 21:42 ` [PATCH 7/13] v2 Use new per-location warning APIs in the FORTRAN " Martin Sebor
2021-06-21 21:42 ` [PING][PATCH " Martin Sebor
2021-06-24 5:05 ` [PATCH " Jeff Law
2021-06-28 21:21 ` Martin Sebor
2021-06-04 21:42 ` [PATCH 8/13] v2 Use new per-location warning APIs in libcc1 Martin Sebor
2021-06-24 5:04 ` Jeff Law
2021-06-28 21:22 ` Martin Sebor
2021-06-04 21:43 ` [PATCH 9/13] v2 Use new per-location warning APIs in LTO Martin Sebor
2021-06-21 21:54 ` [PING][PATCH " Martin Sebor
2021-06-24 9:32 ` Richard Biener
2021-06-24 15:27 ` Martin Sebor
2021-06-25 7:46 ` Richard Biener
2021-06-24 5:03 ` [PATCH " Jeff Law
2021-06-04 21:43 ` [PATCH 10/13] v2 Use new per-location warning APIs in the middle end Martin Sebor
2021-06-21 21:58 ` [PING][PATCH " Martin Sebor
2021-06-24 5:15 ` [PATCH " Jeff Law
2021-06-25 1:40 ` Martin Sebor
2021-06-04 21:43 ` [PATCH 11/13] v2 Use new per-location warning APIs in the Objective-C front end Martin Sebor
2021-06-24 5:02 ` Jeff Law
2021-06-28 21:22 ` Martin Sebor
2021-06-04 21:43 ` [PATCH 12/13] v2 Remove TREE_NO_WARNING and gimple*no_warning* APIs Martin Sebor
2021-06-24 5:01 ` Jeff Law
2021-06-04 21:43 ` [PATCH 13/13] v2 Add regression tests for PR 74765 and 74762 Martin Sebor
2021-06-24 4:56 ` Jeff Law
2021-06-28 21:23 ` Martin Sebor
2021-06-15 1:29 ` [PING][PATCH 0/13] v2 warning control by group and location (PR 74765) Martin Sebor
2021-07-17 20:36 ` [PATCH " Jan-Benedict Glaw
2021-07-19 15:08 ` Martin Sebor
2021-07-28 11:14 ` Andrew Burgess
2021-07-28 16:16 ` Martin Sebor
2021-07-29 8:26 ` Andrew Burgess
2021-07-29 14:41 ` Martin Sebor
2021-05-30 2:06 ` [PATCH 0/11] " Jeff Law
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=87pmr1jweq.fsf@euler.schwinge.homeip.net \
--to=thomas@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=msebor@gmail.com \
/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: link
Be 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).