From 203ca525411f5f8ce957c65a674856044197c05e Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 17 Jul 2025 17:52:13 -0400
Subject: [PATCH 37/41] {needs ChangeLog} rename diagnostic-spec.{cc,h} to
 gcc-diagnostic-spec.{cc,h} as this has GCC-specific stuff in it (options,
 GTY)

---
 gcc/Makefile.in                                    | 5 +++--
 gcc/{diagnostic-spec.cc => gcc-diagnostic-spec.cc} | 2 +-
 gcc/{diagnostic-spec.h => gcc-diagnostic-spec.h}   | 6 +++---
 gcc/gengtype.cc                                    | 2 +-
 gcc/warning-control.cc                             | 2 +-
 5 files changed, 9 insertions(+), 8 deletions(-)
 rename gcc/{diagnostic-spec.cc => gcc-diagnostic-spec.cc} (99%)
 rename gcc/{diagnostic-spec.h => gcc-diagnostic-spec.h} (96%)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index b51ada888ce3..d11277786a5b 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1850,7 +1850,7 @@ OBJS = \
 
 # Objects in libcommon.a, potentially used by all host binaries and with
 # no target dependencies.
-OBJS-libcommon = diagnostic-spec.o diagnostic.o \
+OBJS-libcommon = diagnostic.o \
 	diagnostic-global-context.o \
 	diagnostics/buffering.o \
 	diagnostics/changes.o \
@@ -1872,6 +1872,7 @@ OBJS-libcommon = diagnostic-spec.o diagnostic.o \
 	diagnostics/selftest-logical-locations.o \
 	diagnostics/selftest-paths.o \
 	diagnostics/diagnostics-selftests.o \
+	gcc-diagnostic-spec.o \
 	graphviz.o pex.o \
 	pretty-print.o intl.o \
 	json.o json-parsing.o \
@@ -3043,7 +3044,7 @@ GTFILES = $(CPPLIB_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
   $(srcdir)/ipa-modref-tree.h \
   $(srcdir)/ipa-locality-cloning.cc \
   $(srcdir)/signop.h \
-  $(srcdir)/diagnostic-spec.h $(srcdir)/diagnostic-spec.cc \
+  $(srcdir)/gcc-diagnostic-spec.h $(srcdir)/gcc-diagnostic-spec.cc \
   $(srcdir)/dwarf2out.h \
   $(srcdir)/dwarf2asm.cc \
   $(srcdir)/dwarf2cfi.cc \
diff --git a/gcc/diagnostic-spec.cc b/gcc/gcc-diagnostic-spec.cc
similarity index 99%
rename from gcc/diagnostic-spec.cc
rename to gcc/gcc-diagnostic-spec.cc
index df7857988b6a..d09aeebe1938 100644
--- a/gcc/diagnostic-spec.cc
+++ b/gcc/gcc-diagnostic-spec.cc
@@ -27,7 +27,7 @@
 #include "tree.h"
 #include "cgraph.h"
 #include "hash-map.h"
-#include "diagnostic-spec.h"
+#include "gcc-diagnostic-spec.h"
 #include "pretty-print.h"
 #include "options.h"
 
diff --git a/gcc/diagnostic-spec.h b/gcc/gcc-diagnostic-spec.h
similarity index 96%
rename from gcc/diagnostic-spec.h
rename to gcc/gcc-diagnostic-spec.h
index 13455ce1a615..2b5e784d238d 100644
--- a/gcc/diagnostic-spec.h
+++ b/gcc/gcc-diagnostic-spec.h
@@ -19,8 +19,8 @@
    along with GCC; see the file COPYING3.  If not see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef DIAGNOSTIC_SPEC_H_INCLUDED
-#define DIAGNOSTIC_SPEC_H_INCLUDED
+#ifndef GCC_DIAGNOSTIC_SPEC_H_INCLUDED
+#define GCC_DIAGNOSTIC_SPEC_H_INCLUDED
 
 #include "hash-map.h"
 
@@ -146,4 +146,4 @@ 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(()) nowarn_map_t *nowarn_map;
 
-#endif // DIAGNOSTIC_SPEC_H_INCLUDED
+#endif // GCC_DIAGNOSTIC_SPEC_H_INCLUDED
diff --git a/gcc/gengtype.cc b/gcc/gengtype.cc
index 6a3621c96cd1..84c763620472 100644
--- a/gcc/gengtype.cc
+++ b/gcc/gengtype.cc
@@ -1722,7 +1722,7 @@ open_base_files (void)
       "target-globals.h", "ipa-ref.h", "cgraph.h", "symbol-summary.h",
       "sreal.h", "ipa-cp.h", "ipa-prop.h", "ipa-fnsummary.h", "dwarf2out.h",
       "omp-general.h", "omp-offload.h", "ipa-modref-tree.h", "ipa-modref.h",
-      "symtab-thunks.h", "symtab-clones.h", "diagnostic-spec.h", "ctfc.h",
+      "symtab-thunks.h", "symtab-clones.h", "gcc-diagnostic-spec.h", "ctfc.h",
       NULL
     };
     const char *const *ifp;
diff --git a/gcc/warning-control.cc b/gcc/warning-control.cc
index 48446a772e9d..e04ef69fcf4c 100644
--- a/gcc/warning-control.cc
+++ b/gcc/warning-control.cc
@@ -28,7 +28,7 @@
 #include "gimple.h"
 #include "cgraph.h"
 #include "hash-map.h"
-#include "diagnostic-spec.h"
+#include "gcc-diagnostic-spec.h"
 
 /* Return the no-warning bit for EXPR.  */
 
-- 
2.26.3

