]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
diagnostics: move diagnostic-macro-unwinding.{cc,h} -> diagnostics/macro-unwinding...
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 25 Jul 2025 19:13:38 +0000 (15:13 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 25 Jul 2025 19:13:38 +0000 (15:13 -0400)
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>
gcc/Makefile.in
gcc/c-family/c-opts.cc
gcc/diagnostics/macro-unwinding.cc [moved from gcc/diagnostic-macro-unwinding.cc with 96% similarity]
gcc/diagnostics/macro-unwinding.h [moved from gcc/diagnostic-macro-unwinding.h with 69% similarity]
gcc/diagnostics/paths-output.cc

index 6289dcae8f255efd2f636f57abf96c498b8b2139..a7c184ceae0e90fa813cac044cc3193285305f8c 100644 (file)
@@ -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 \
index a211992e1b54eafa54aac1a63a12b0cf2daf883b..96130d71afdbc53776e7b1ce4c373acbcb96df89 100644 (file)
@@ -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);
 }
similarity index 96%
rename from gcc/diagnostic-macro-unwinding.cc
rename to gcc/diagnostics/macro-unwinding.cc
index 7650606840415578358fb8db3c7a98413f7ba1ea..66bad1c32a75bcddded14e75adf63856bf681669 100644 (file)
@@ -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
similarity index 69%
rename from gcc/diagnostic-macro-unwinding.h
rename to gcc/diagnostics/macro-unwinding.h
index b2173bcee256c0afbc317a0b7847efb97a45e243..1f28d584c2586360338fa5aad646ef94246fe540 100644 (file)
@@ -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 */
index 599d6849cfc73627215d463686235e031396955e..5cf61ceb10bfe2e92e6592f5b6fa089e027af63a 100644 (file)
@@ -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"