From: David Malcolm Date: Thu, 18 Sep 2025 20:06:39 +0000 (-0400) Subject: diagnostics: use diagnostic.h in fewer places X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60d748800835fba95e1147d82755135035b9acbb;p=thirdparty%2Fgcc.git diagnostics: use diagnostic.h in fewer places No functional change intended. gcc/ChangeLog: * diagnostics/buffering.cc: Drop include of "diagnostic.h". * diagnostics/buffering.h: Likewise. * diagnostics/context.h (diagnostics::metadata): Add forward decl. * diagnostics/html-sink.cc: Drop include of "diagnostic.h". * diagnostics/lazy-paths.cc: Likewise. * diagnostics/macro-unwinding.cc: Likewise. * diagnostics/macro-unwinding.h (diagnostics:diagnostic_info): Add forward decl. * diagnostics/option-classifier.h: Include "diagnostics/option-id.h" and "diagnostics/kinds.h". (diagnostics:diagnostic_info): Add forward decl. * diagnostics/output-spec.cc: Drop include of "diagnostic.h". * diagnostics/paths-output.cc: Likewise. * diagnostics/paths.cc: Likewise. * diagnostics/sarif-sink.cc: Likewise. * diagnostics/selftest-context.cc: Likewise. * diagnostics/selftest-paths.cc: Likewise. * diagnostics/source-printing-options.h: Include "rich-location.h". * diagnostics/text-sink.cc: Drop include of "diagnostic.h". Signed-off-by: David Malcolm --- diff --git a/gcc/diagnostics/buffering.cc b/gcc/diagnostics/buffering.cc index b09d1c2cc15..019c9927c6d 100644 --- a/gcc/diagnostics/buffering.cc +++ b/gcc/diagnostics/buffering.cc @@ -21,7 +21,6 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "system.h" #include "coretypes.h" -#include "diagnostic.h" #include "diagnostics/buffering.h" #include "diagnostics/sink.h" #include "diagnostics/dumping.h" diff --git a/gcc/diagnostics/buffering.h b/gcc/diagnostics/buffering.h index 9b86fee90fe..24a57e4a5f9 100644 --- a/gcc/diagnostics/buffering.h +++ b/gcc/diagnostics/buffering.h @@ -21,7 +21,7 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_DIAGNOSTICS_BUFFERING_H #define GCC_DIAGNOSTICS_BUFFERING_H -#include "diagnostic.h" +#include "diagnostics/counters.h" namespace diagnostics { diff --git a/gcc/diagnostics/context.h b/gcc/diagnostics/context.h index 9464f6adb6c..7d7c87250be 100644 --- a/gcc/diagnostics/context.h +++ b/gcc/diagnostics/context.h @@ -47,6 +47,7 @@ namespace diagnostics { class diagram; class sink; class text_sink; + class metadata; class source_effect_info; diff --git a/gcc/diagnostics/html-sink.cc b/gcc/diagnostics/html-sink.cc index 64dcefeedaa..d3fb107e614 100644 --- a/gcc/diagnostics/html-sink.cc +++ b/gcc/diagnostics/html-sink.cc @@ -24,7 +24,6 @@ along with GCC; see the file COPYING3. If not see #define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" -#include "diagnostic.h" #include "diagnostics/metadata.h" #include "diagnostics/sink.h" #include "diagnostics/html-sink.h" diff --git a/gcc/diagnostics/lazy-paths.cc b/gcc/diagnostics/lazy-paths.cc index f246eea9420..d25f8fb3781 100644 --- a/gcc/diagnostics/lazy-paths.cc +++ b/gcc/diagnostics/lazy-paths.cc @@ -23,7 +23,6 @@ along with GCC; see the file COPYING3. If not see #define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" -#include "diagnostic.h" #include "diagnostics/lazy-paths.h" #include "selftest.h" #include "diagnostics/selftest-context.h" diff --git a/gcc/diagnostics/macro-unwinding.cc b/gcc/diagnostics/macro-unwinding.cc index 66bad1c32a7..fb4ee65f424 100644 --- a/gcc/diagnostics/macro-unwinding.cc +++ b/gcc/diagnostics/macro-unwinding.cc @@ -21,7 +21,6 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tree.h" -#include "diagnostic.h" #include "diagnostics/macro-unwinding.h" #include "diagnostics/text-sink.h" #include "intl.h" diff --git a/gcc/diagnostics/macro-unwinding.h b/gcc/diagnostics/macro-unwinding.h index 1f28d584c25..1df8715e2bd 100644 --- a/gcc/diagnostics/macro-unwinding.h +++ b/gcc/diagnostics/macro-unwinding.h @@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. If not see namespace diagnostics { +struct diagnostic_info; + extern void virt_loc_aware_text_finalizer (text_sink &, const diagnostic_info *); diff --git a/gcc/diagnostics/option-classifier.h b/gcc/diagnostics/option-classifier.h index 3b16c740b7e..9457fe8d133 100644 --- a/gcc/diagnostics/option-classifier.h +++ b/gcc/diagnostics/option-classifier.h @@ -20,10 +20,14 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_DIAGNOSTICS_OPTION_CLASSIFIER_H #define GCC_DIAGNOSTICS_OPTION_CLASSIFIER_H +#include "diagnostics/option-id.h" +#include "diagnostics/kinds.h" + namespace diagnostics { /* Forward declarations. */ class context; +struct diagnostic_info; /* A stack of sets of classifications: each entry in the stack is a mapping from option index to diagnostic severity that can be changed diff --git a/gcc/diagnostics/output-spec.cc b/gcc/diagnostics/output-spec.cc index e25d25a9a9a..8ec638a83bf 100644 --- a/gcc/diagnostics/output-spec.cc +++ b/gcc/diagnostics/output-spec.cc @@ -31,7 +31,6 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "version.h" #include "intl.h" -#include "diagnostic.h" #include "diagnostics/color.h" #include "diagnostics/sink.h" #include "diagnostics/html-sink.h" diff --git a/gcc/diagnostics/paths-output.cc b/gcc/diagnostics/paths-output.cc index a3ac9a0519a..2c97bf40679 100644 --- a/gcc/diagnostics/paths-output.cc +++ b/gcc/diagnostics/paths-output.cc @@ -25,7 +25,6 @@ along with GCC; see the file COPYING3. If not see #define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" -#include "diagnostic.h" #include "diagnostics/macro-unwinding.h" #include "intl.h" #include "diagnostics/paths.h" diff --git a/gcc/diagnostics/paths.cc b/gcc/diagnostics/paths.cc index bc769c45766..824b810cb3b 100644 --- a/gcc/diagnostics/paths.cc +++ b/gcc/diagnostics/paths.cc @@ -25,7 +25,6 @@ along with GCC; see the file COPYING3. If not see #define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" -#include "diagnostic.h" #include "diagnostics/paths.h" #include "diagnostics/state-graphs.h" diff --git a/gcc/diagnostics/sarif-sink.cc b/gcc/diagnostics/sarif-sink.cc index bc121388bb8..144040e9dfb 100644 --- a/gcc/diagnostics/sarif-sink.cc +++ b/gcc/diagnostics/sarif-sink.cc @@ -26,7 +26,6 @@ along with GCC; see the file COPYING3. If not see #define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" -#include "diagnostic.h" #include "diagnostics/metadata.h" #include "diagnostics/digraphs.h" #include "diagnostics/state-graphs.h" diff --git a/gcc/diagnostics/selftest-context.cc b/gcc/diagnostics/selftest-context.cc index 2b6dd0b331f..2eced4d3cd8 100644 --- a/gcc/diagnostics/selftest-context.cc +++ b/gcc/diagnostics/selftest-context.cc @@ -20,7 +20,6 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "system.h" #include "coretypes.h" -#include "diagnostic.h" #include "diagnostics/sink.h" #include "selftest.h" #include "diagnostics/selftest-context.h" diff --git a/gcc/diagnostics/selftest-paths.cc b/gcc/diagnostics/selftest-paths.cc index 56ce7ffcae1..e28d18a6370 100644 --- a/gcc/diagnostics/selftest-paths.cc +++ b/gcc/diagnostics/selftest-paths.cc @@ -24,7 +24,6 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "version.h" -#include "diagnostic.h" #include "diagnostics/selftest-paths.h" #if CHECKING_P diff --git a/gcc/diagnostics/source-printing-options.h b/gcc/diagnostics/source-printing-options.h index 362b691c90c..842a3e77d20 100644 --- a/gcc/diagnostics/source-printing-options.h +++ b/gcc/diagnostics/source-printing-options.h @@ -20,6 +20,8 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_DIAGNOSTICS_SOURCE_PRINTING_OPTIONS_H #define GCC_DIAGNOSTICS_SOURCE_PRINTING_OPTIONS_H +#include "rich-location.h" + namespace diagnostics { /* A bundle of options relating to printing the user's source code diff --git a/gcc/diagnostics/text-sink.cc b/gcc/diagnostics/text-sink.cc index d4cfb89347f..f9a2bffb263 100644 --- a/gcc/diagnostics/text-sink.cc +++ b/gcc/diagnostics/text-sink.cc @@ -24,7 +24,6 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "version.h" #include "intl.h" -#include "diagnostic.h" #include "diagnostics/color.h" #include "diagnostics/url.h" #include "diagnostics/metadata.h"