public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5276] Use 'location_hash' for 'gcc/diagnostic-spec.h:nowarn_map'
@ 2021-11-15 17:03 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2021-11-15 17:03 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f861ed8b29a5eb6164d1ddbcfbb6232dddae713f

commit r12-5276-gf861ed8b29a5eb6164d1ddbcfbb6232dddae713f
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Tue Aug 31 23:35:15 2021 +0200

    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.

Diff:
---
 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-15 17:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 17:03 [gcc r12-5276] Use 'location_hash' for 'gcc/diagnostic-spec.h:nowarn_map' Thomas Schwinge

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).