aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic-macro-unwinding.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2024-06-18 10:59:56 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2024-06-18 10:59:56 -0400
commitbdcfe7f7f50ec64b45581a175d1eca41c74a3dfe (patch)
treee9ac7326eca1f8ec1763d86e509a92a26b2a5133 /gcc/diagnostic-macro-unwinding.h
parentd3878c85f331c7a378245b636d5d230735b87347 (diff)
downloadgcc-bdcfe7f7f50ec64b45581a175d1eca41c74a3dfe.zip
gcc-bdcfe7f7f50ec64b45581a175d1eca41c74a3dfe.tar.gz
gcc-bdcfe7f7f50ec64b45581a175d1eca41c74a3dfe.tar.bz2
diagnostics: introduce diagnostic-macro-unwinding.h/cc
Eliminate a dependency on "tree" from the code used by diagnostic_path handling. No functional change intended. gcc/ChangeLog: * Makefile.in (OBJS): Add diagnostic-macro-unwinding.o. gcc/c-family/ChangeLog: * c-opts.cc: Replace include of "tree-diagnostic.h" with "diagnostic-macro-unwinding.h". gcc/ChangeLog: * diagnostic-macro-unwinding.cc: New file, with material taken from tree-diagnostic.cc. * diagnostic-macro-unwinding.h: New file, with material taken from tree-diagnostic.h. * tree-diagnostic-path.cc: Repalce include of "tree-diagnostic.h" with "diagnostic-macro-unwinding.h". * tree-diagnostic.cc (struct loc_map_pair): Move to diagnostic-macro-unwinding.cc. (maybe_unwind_expanded_macro_loc): Likewise. (virt_loc_aware_diagnostic_finalizer): Likewise. * tree-diagnostic.h (virt_loc_aware_diagnostic_finalizer): Move decl to diagnostic-macro-unwinding.h. (maybe_unwind_expanded_macro_loc): Likewise. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/diagnostic-macro-unwinding.h')
-rw-r--r--gcc/diagnostic-macro-unwinding.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/diagnostic-macro-unwinding.h b/gcc/diagnostic-macro-unwinding.h
new file mode 100644
index 0000000..74083cd
--- /dev/null
+++ b/gcc/diagnostic-macro-unwinding.h
@@ -0,0 +1,29 @@
+/* Code for unwinding macro expansions in diagnostics.
+ Copyright (C) 2000-2024 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+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
+
+void virt_loc_aware_diagnostic_finalizer (diagnostic_context *,
+ const diagnostic_info *);
+
+extern void maybe_unwind_expanded_macro_loc (diagnostic_context *context,
+ location_t where);
+
+#endif /* ! GCC_DIAGNOSTIC_MACRO_UNWINDING_H */