diff options
author | David Malcolm <dmalcolm@redhat.com> | 2025-07-25 15:13:38 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2025-07-25 15:13:38 -0400 |
commit | e3565f244f462826469c086d0152b6e4cbd60488 (patch) | |
tree | c610275181cdc1509bf46c59074cbfaadd81d113 | |
parent | e31ec9ee65386a7cf978c204e123b9a97eb9c296 (diff) | |
download | gcc-e3565f244f462826469c086d0152b6e4cbd60488.zip gcc-e3565f244f462826469c086d0152b6e4cbd60488.tar.gz gcc-e3565f244f462826469c086d0152b6e4cbd60488.tar.bz2 |
diagnostics: move diagnostic-macro-unwinding.{cc,h} -> diagnostics/macro-unwinding.{cc,h}
gcc/ChangeLog:
* Makefile.in (OBJS): Replace diagnostic-macro-unwinding.o with
diagnostics/macro-unwinding.o.
* diagnostic-macro-unwinding.cc: Move to...
* diagnostics/macro-unwinding.cc: ...here, moving content into
namespace diagnostics.
* diagnostic-macro-unwinding.h: Move to...
* diagnostics/macro-unwinding.h: ...here, moving content into
namespace diagnostics.
* diagnostics/paths-output.cc: Update for move of
"diagnostic-macro-unwinding.h" to "diagnostics/macro-unwinding.h".
gcc/c-family/ChangeLog:
* c-opts.cc: Update for move of "diagnostic-macro-unwinding.h"
to "diagnostics/macro-unwinding.h".
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
-rw-r--r-- | gcc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/c-family/c-opts.cc | 4 | ||||
-rw-r--r-- | gcc/diagnostics/macro-unwinding.cc (renamed from gcc/diagnostic-macro-unwinding.cc) | 15 | ||||
-rw-r--r-- | gcc/diagnostics/macro-unwinding.h (renamed from gcc/diagnostic-macro-unwinding.h) | 16 | ||||
-rw-r--r-- | gcc/diagnostics/paths-output.cc | 2 |
5 files changed, 24 insertions, 15 deletions
diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 6289dca..a7c184c 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1854,13 +1854,13 @@ OBJS = \ # no target dependencies. OBJS-libcommon = diagnostic-spec.o diagnostic.o diagnostic-color.o \ diagnostic-global-context.o \ - diagnostic-macro-unwinding.o \ diagnostics/digraphs.o \ diagnostics/edit-context.o \ diagnostics/output-spec.o \ diagnostics/html-sink.o \ diagnostics/sarif-sink.o \ diagnostics/text-sink.o \ + diagnostics/macro-unwinding.o \ diagnostics/paths.o \ diagnostics/paths-output.o \ diagnostics/source-printing.o \ diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc index a211992..96130d7 100644 --- a/gcc/c-family/c-opts.cc +++ b/gcc/c-family/c-opts.cc @@ -32,7 +32,7 @@ along with GCC; see the file COPYING3. If not see #include "flags.h" #include "toplev.h" #include "langhooks.h" -#include "diagnostic-macro-unwinding.h" /* for virt_loc_aware_diagnostic_finalizer */ +#include "diagnostics/macro-unwinding.h" /* for virt_loc_aware_diagnostic_finalizer */ #include "intl.h" #include "cppdefault.h" #include "incpath.h" @@ -182,7 +182,7 @@ c_diagnostic_text_finalizer (diagnostics::text_sink &text_output, diagnostic->richloc, diagnostic->kind, pp); /* By default print macro expansion contexts in the diagnostic finalizer -- for tokens resulting from macro expansion. */ - virt_loc_aware_diagnostic_finalizer (text_output, diagnostic); + diagnostics::virt_loc_aware_text_finalizer (text_output, diagnostic); pp_set_prefix (pp, saved_prefix); pp_flush (pp); } diff --git a/gcc/diagnostic-macro-unwinding.cc b/gcc/diagnostics/macro-unwinding.cc index 7650606..66bad1c 100644 --- a/gcc/diagnostic-macro-unwinding.cc +++ b/gcc/diagnostics/macro-unwinding.cc @@ -22,10 +22,12 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "tree.h" #include "diagnostic.h" -#include "diagnostic-macro-unwinding.h" +#include "diagnostics/macro-unwinding.h" #include "diagnostics/text-sink.h" #include "intl.h" +namespace diagnostics { + /* This is a pair made of a location and the line map it originated from. It's used in the maybe_unwind_expanded_macro_loc function below. */ @@ -73,7 +75,7 @@ struct loc_map_pair function. */ void -maybe_unwind_expanded_macro_loc (diagnostics::text_sink &text_output, +maybe_unwind_expanded_macro_loc (text_sink &text_output, location_t where) { const struct line_map *map; @@ -215,8 +217,11 @@ maybe_unwind_expanded_macro_loc (diagnostics::text_sink &text_output, that is similar to what is done for function call stacks, or template instantiation contexts. */ void -virt_loc_aware_diagnostic_finalizer (diagnostics::text_sink &text_output, - const diagnostic_info *diagnostic) +virt_loc_aware_text_finalizer (text_sink &text_output, + const diagnostic_info *diagnostic) { - maybe_unwind_expanded_macro_loc (text_output, diagnostic_location (diagnostic)); + maybe_unwind_expanded_macro_loc (text_output, + diagnostic_location (diagnostic)); } + +} // namespace diagnostics diff --git a/gcc/diagnostic-macro-unwinding.h b/gcc/diagnostics/macro-unwinding.h index b2173bc..1f28d58 100644 --- a/gcc/diagnostic-macro-unwinding.h +++ b/gcc/diagnostics/macro-unwinding.h @@ -17,13 +17,17 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ -#ifndef GCC_DIAGNOSTIC_MACRO_UNWINDING_H -#define GCC_DIAGNOSTIC_MACRO_UNWINDING_H +#ifndef GCC_DIAGNOSTICS_MACRO_UNWINDING_H +#define GCC_DIAGNOSTICS_MACRO_UNWINDING_H -void virt_loc_aware_diagnostic_finalizer (diagnostics::text_sink &, - const diagnostic_info *); +namespace diagnostics { -extern void maybe_unwind_expanded_macro_loc (diagnostics::text_sink &, +extern void virt_loc_aware_text_finalizer (text_sink &, + const diagnostic_info *); + +extern void maybe_unwind_expanded_macro_loc (text_sink &, location_t where); -#endif /* ! GCC_DIAGNOSTIC_MACRO_UNWINDING_H */ +} // namespace diagnostics + +#endif /* ! GCC_DIAGNOSTICS_MACRO_UNWINDING_H */ diff --git a/gcc/diagnostics/paths-output.cc b/gcc/diagnostics/paths-output.cc index 599d684..5cf61ce 100644 --- a/gcc/diagnostics/paths-output.cc +++ b/gcc/diagnostics/paths-output.cc @@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "diagnostic.h" -#include "diagnostic-macro-unwinding.h" +#include "diagnostics/macro-unwinding.h" #include "intl.h" #include "diagnostics/paths.h" #include "gcc-rich-location.h" |