From ae13020e2039f65f07a38ac21d0e08041704e25c Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 17 Jul 2025 15:18:03 -0400
Subject: [PATCH 32/41] {needs ChangeLog} move gcc/diagnostic-color.{h,cc} to
 gcc/diagnostics/color.{h,cc}

---
 gcc/Makefile.in                                          | 5 +++--
 gcc/cobol/util.cc                                        | 2 +-
 gcc/common.opt                                           | 2 +-
 gcc/cp/error.cc                                          | 2 +-
 gcc/diagnostic.cc                                        | 2 +-
 gcc/{diagnostic-color.cc => diagnostics/color.cc}        | 4 ++--
 gcc/{diagnostic-color.h => diagnostics/color.h}          | 0
 gcc/diagnostics/edit-context.cc                          | 2 +-
 gcc/diagnostics/output-spec.cc                           | 2 +-
 gcc/diagnostics/paths-output.cc                          | 2 +-
 gcc/diagnostics/source-printing.cc                       | 2 +-
 gcc/diagnostics/text-sink.cc                             | 2 +-
 gcc/fortran/error.cc                                     | 2 +-
 gcc/libgdiagnostics.cc                                   | 2 +-
 gcc/m2/gm2-gcc/m2color.cc                                | 2 +-
 gcc/opts.cc                                              | 2 +-
 gcc/pretty-print-markup.h                                | 2 +-
 gcc/pretty-print.cc                                      | 2 +-
 gcc/selftest-run-tests.cc                                | 2 +-
 gcc/selftest.h                                           | 2 +-
 gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.cc   | 2 +-
 gcc/testsuite/gcc.dg/plugin/analyzer_kernel_plugin.cc    | 2 +-
 gcc/testsuite/gcc.dg/plugin/analyzer_known_fns_plugin.cc | 2 +-
 gcc/text-art/style.cc                                    | 2 +-
 24 files changed, 26 insertions(+), 25 deletions(-)
 rename gcc/{diagnostic-color.cc => diagnostics/color.cc} (99%)
 rename gcc/{diagnostic-color.h => diagnostics/color.h} (100%)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f1f71733cbc6..b1880add25aa 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1851,9 +1851,10 @@ OBJS = \
 
 # Objects in libcommon.a, potentially used by all host binaries and with
 # no target dependencies.
-OBJS-libcommon = diagnostic-spec.o diagnostic.o diagnostic-color.o \
+OBJS-libcommon = diagnostic-spec.o diagnostic.o \
 	diagnostic-global-context.o \
 	diagnostics/buffering.o \
+	diagnostics/color.o \
 	diagnostics/digraphs.o \
 	diagnostics/edit-context.o \
 	diagnostics/output-spec.o \
@@ -4074,7 +4075,7 @@ PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
   fold-const.h fold-const-call.h tree-cfg.h tree-into-ssa.h tree-ssanames.h \
   print-tree.h varasm.h context.h tree-phinodes.h stor-layout.h \
   ssa-iterators.h $(RESOURCE_H) tree-cfgcleanup.h attribs.h calls.h \
-  cfgexpand.h diagnostic-color.h gcc-symtab.h gimple-builder.h gimple-low.h \
+  cfgexpand.h gcc-symtab.h gimple-builder.h gimple-low.h \
   gimple-walk.h gimplify-me.h pass_manager.h print-rtl.h stmt.h \
   tree-dfa.h tree-hasher.h tree-nested.h tree-object-size.h tree-outof-ssa.h \
   tree-parloops.h tree-ssa-address.h tree-ssa-coalesce.h tree-ssa-dom.h \
diff --git a/gcc/cobol/util.cc b/gcc/cobol/util.cc
index 8bf0d002de27..c6a286fec22e 100644
--- a/gcc/cobol/util.cc
+++ b/gcc/cobol/util.cc
@@ -47,7 +47,7 @@
 #include "intl.h"
 #include "backtrace.h"
 #include "diagnostic.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "opts.h"
 #include "util.h"
 #include "cbldiag.h"
diff --git a/gcc/common.opt b/gcc/common.opt
index b4845d278e48..91727a002ab7 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1437,7 +1437,7 @@ Driver Common Joined RejectNegative Var(flag_diagnostics_show_color) Enum(diagno
 
 ; Required for these enum values.
 SourceInclude
-diagnostic-color.h
+diagnostics/color.h
 
 Enum
 Name(diagnostic_color_rule) Type(int)
diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc
index e8e897d1ffa1..e4cd92c5483f 100644
--- a/gcc/cp/error.cc
+++ b/gcc/cp/error.cc
@@ -24,7 +24,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "cp-tree.h"
 #include "stringpool.h"
 #include "tree-diagnostic.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "langhooks-def.h"
 #include "intl.h"
 #include "cxx-pretty-print.h"
diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc
index 4d1b253bbe93..c6e5523b974a 100644
--- a/gcc/diagnostic.cc
+++ b/gcc/diagnostic.cc
@@ -31,7 +31,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "intl.h"
 #include "backtrace.h"
 #include "diagnostic.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "diagnostic-url.h"
 #include "diagnostics/metadata.h"
 #include "diagnostics/paths.h"
diff --git a/gcc/diagnostic-color.cc b/gcc/diagnostics/color.cc
similarity index 99%
rename from gcc/diagnostic-color.cc
rename to gcc/diagnostics/color.cc
index e95aaeb869cf..68a50f2e5001 100644
--- a/gcc/diagnostic-color.cc
+++ b/gcc/diagnostics/color.cc
@@ -19,7 +19,7 @@
 #include "config.h"
 #define INCLUDE_VECTOR
 #include "system.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "diagnostic-url.h"
 #include "label-text.h"
 
@@ -522,7 +522,7 @@ test_color_dict_envvar_parsing ()
 /* Run all of the selftests within this file.  */
 
 void
-diagnostic_color_cc_tests ()
+diagnostics_color_cc_tests ()
 {
   test_empty_color_dict ();
   test_default_color_dict ();
diff --git a/gcc/diagnostic-color.h b/gcc/diagnostics/color.h
similarity index 100%
rename from gcc/diagnostic-color.h
rename to gcc/diagnostics/color.h
diff --git a/gcc/diagnostics/edit-context.cc b/gcc/diagnostics/edit-context.cc
index e8c328d3a3db..4ca571b92466 100644
--- a/gcc/diagnostics/edit-context.cc
+++ b/gcc/diagnostics/edit-context.cc
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "line-map.h"
 #include "diagnostics/edit-context.h"
 #include "pretty-print.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "selftest.h"
 
 namespace diagnostics {
diff --git a/gcc/diagnostics/output-spec.cc b/gcc/diagnostics/output-spec.cc
index 699b5ac3bae7..433f3af6f609 100644
--- a/gcc/diagnostics/output-spec.cc
+++ b/gcc/diagnostics/output-spec.cc
@@ -32,7 +32,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "version.h"
 #include "intl.h"
 #include "diagnostic.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "diagnostics/sink.h"
 #include "diagnostics/html-sink.h"
 #include "diagnostics/text-sink.h"
diff --git a/gcc/diagnostics/paths-output.cc b/gcc/diagnostics/paths-output.cc
index 1815223ee020..5ccc3b0a0d24 100644
--- a/gcc/diagnostics/paths-output.cc
+++ b/gcc/diagnostics/paths-output.cc
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "intl.h"
 #include "diagnostics/paths.h"
 #include "gcc-rich-location.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "diagnostics/event-id.h"
 #include "diagnostics/source-printing-effects.h"
 #include "pretty-print-markup.h"
diff --git a/gcc/diagnostics/source-printing.cc b/gcc/diagnostics/source-printing.cc
index cd642b96370e..ab18d8005f35 100644
--- a/gcc/diagnostics/source-printing.cc
+++ b/gcc/diagnostics/source-printing.cc
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "intl.h"
 #include "backtrace.h"
 #include "diagnostic.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "gcc-rich-location.h"
 #include "text-range-label.h"
 #include "selftest.h"
diff --git a/gcc/diagnostics/text-sink.cc b/gcc/diagnostics/text-sink.cc
index 41923abc7582..695f2f771f76 100644
--- a/gcc/diagnostics/text-sink.cc
+++ b/gcc/diagnostics/text-sink.cc
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "version.h"
 #include "intl.h"
 #include "diagnostic.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "diagnostic-url.h"
 #include "diagnostics/metadata.h"
 #include "diagnostics/paths.h"
diff --git a/gcc/fortran/error.cc b/gcc/fortran/error.cc
index e7e50a96a8c0..a9e99b4c3da0 100644
--- a/gcc/fortran/error.cc
+++ b/gcc/fortran/error.cc
@@ -31,7 +31,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gfortran.h"
 
 #include "diagnostic.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "tree-diagnostic.h" /* tree_diagnostics_defaults */
 #include "diagnostics/text-sink.h"
 
diff --git a/gcc/libgdiagnostics.cc b/gcc/libgdiagnostics.cc
index 389a11d5dea6..868f9db731f1 100644
--- a/gcc/libgdiagnostics.cc
+++ b/gcc/libgdiagnostics.cc
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "intl.h"
 #include "diagnostic.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "diagnostic-url.h"
 #include "diagnostics/metadata.h"
 #include "diagnostics/paths.h"
diff --git a/gcc/m2/gm2-gcc/m2color.cc b/gcc/m2/gm2-gcc/m2color.cc
index fd30f4684a9a..a638d7ce5ae8 100644
--- a/gcc/m2/gm2-gcc/m2color.cc
+++ b/gcc/m2/gm2-gcc/m2color.cc
@@ -23,7 +23,7 @@ along with GNU Modula-2; see the file COPYING3.  If not see
 #include "m2color.h"
 
 #include "gcc-consolidation.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 
 
 char *
diff --git a/gcc/opts.cc b/gcc/opts.cc
index 2a18a3b441f7..62d5f8b59ca5 100644
--- a/gcc/opts.cc
+++ b/gcc/opts.cc
@@ -31,7 +31,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "common/common-target.h"
 #include "spellcheck.h"
 #include "opt-suggestions.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "diagnostics/sink.h"
 #include "version.h"
 #include "selftest.h"
diff --git a/gcc/pretty-print-markup.h b/gcc/pretty-print-markup.h
index 6c0719d3e922..e4346f15c0cb 100644
--- a/gcc/pretty-print-markup.h
+++ b/gcc/pretty-print-markup.h
@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_PRETTY_PRINT_MARKUP_H
 #define GCC_PRETTY_PRINT_MARKUP_H
 
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 
 class pp_token_list;
 
diff --git a/gcc/pretty-print.cc b/gcc/pretty-print.cc
index 9c137ddeeef6..01b90b234fa1 100644
--- a/gcc/pretty-print.cc
+++ b/gcc/pretty-print.cc
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "pretty-print-format-impl.h"
 #include "pretty-print-markup.h"
 #include "pretty-print-urlifier.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "diagnostics/event-id.h"
 #include "diagnostic-highlight-colors.h"
 #include "auto-obstack.h"
diff --git a/gcc/selftest-run-tests.cc b/gcc/selftest-run-tests.cc
index b442f5325847..f88c1cf6dc79 100644
--- a/gcc/selftest-run-tests.cc
+++ b/gcc/selftest-run-tests.cc
@@ -98,7 +98,7 @@ selftest::run_tests ()
 
   /* Higher-level tests, or for components that other selftests don't
      rely on.  */
-  diagnostic_color_cc_tests ();
+  diagnostics_color_cc_tests ();
   diagnostics_source_printing_cc_tests ();
   diagnostics_html_sink_cc_tests ();
   diagnostics_sarif_sink_cc_tests ();
diff --git a/gcc/selftest.h b/gcc/selftest.h
index 99a574bf3dd7..06ce4a01f3a4 100644
--- a/gcc/selftest.h
+++ b/gcc/selftest.h
@@ -221,7 +221,7 @@ extern void bitmap_cc_tests ();
 extern void cgraph_cc_tests ();
 extern void convert_cc_tests ();
 extern void dbgcnt_cc_tests ();
-extern void diagnostic_color_cc_tests ();
+extern void diagnostics_color_cc_tests ();
 extern void diagnostics_digraphs_cc_tests ();
 extern void diagnostics_html_sink_cc_tests ();
 extern void diagnostics_lazy_paths_cc_tests ();
diff --git a/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.cc b/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.cc
index fe59b72db0c2..01ab76683d3a 100644
--- a/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.cc
+++ b/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.cc
@@ -23,7 +23,7 @@
 #include "target.h"
 #include "fold-const.h"
 #include "tree-pretty-print.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "diagnostics/metadata.h"
 #include "tristate.h"
 #include "bitmap.h"
diff --git a/gcc/testsuite/gcc.dg/plugin/analyzer_kernel_plugin.cc b/gcc/testsuite/gcc.dg/plugin/analyzer_kernel_plugin.cc
index bbcdb7ae089f..fc282a7c1618 100644
--- a/gcc/testsuite/gcc.dg/plugin/analyzer_kernel_plugin.cc
+++ b/gcc/testsuite/gcc.dg/plugin/analyzer_kernel_plugin.cc
@@ -23,7 +23,7 @@
 #include "target.h"
 #include "fold-const.h"
 #include "tree-pretty-print.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "diagnostics/metadata.h"
 #include "tristate.h"
 #include "bitmap.h"
diff --git a/gcc/testsuite/gcc.dg/plugin/analyzer_known_fns_plugin.cc b/gcc/testsuite/gcc.dg/plugin/analyzer_known_fns_plugin.cc
index 1c0cc60db730..44fcf37c7029 100644
--- a/gcc/testsuite/gcc.dg/plugin/analyzer_known_fns_plugin.cc
+++ b/gcc/testsuite/gcc.dg/plugin/analyzer_known_fns_plugin.cc
@@ -23,7 +23,7 @@
 #include "target.h"
 #include "fold-const.h"
 #include "tree-pretty-print.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 #include "diagnostics/metadata.h"
 #include "tristate.h"
 #include "bitmap.h"
diff --git a/gcc/text-art/style.cc b/gcc/text-art/style.cc
index ffc75b6d1b02..40886d691df5 100644
--- a/gcc/text-art/style.cc
+++ b/gcc/text-art/style.cc
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "text-art/selftests.h"
 #include "text-art/types.h"
 #include "color-macros.h"
-#include "diagnostic-color.h"
+#include "diagnostics/color.h"
 
 using namespace text_art;
 
-- 
2.26.3

