aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2023-11-19 06:26:40 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2023-11-19 06:26:40 -0500
commit78d132d73ec3784a77b3e2391a540bcdae714bb0 (patch)
tree2e9ff8838a5c3f6c108b3e4a03788a55e91d181c /gcc
parentaf7fa3135b6b046fe3ba869993221042a65301eb (diff)
downloadgcc-78d132d73ec3784a77b3e2391a540bcdae714bb0.zip
gcc-78d132d73ec3784a77b3e2391a540bcdae714bb0.tar.gz
gcc-78d132d73ec3784a77b3e2391a540bcdae714bb0.tar.bz2
libcpp: split decls out to rich-location.h
The various decls relating to rich_location are in libcpp/include/line-map.h, but they don't relate to line maps. Split them out to their own header: libcpp/include/rich-location.h No functional change intended. gcc/ChangeLog: * Makefile.in (CPPLIB_H): Add libcpp/include/rich-location.h. * coretypes.h (class rich_location): New forward decl. gcc/analyzer/ChangeLog: * analyzer.h: Include "rich-location.h". gcc/c-family/ChangeLog: * c-lex.cc: Include "rich-location.h". gcc/cp/ChangeLog: * mapper-client.cc: Include "rich-location.h". gcc/ChangeLog: * diagnostic.h: Include "rich-location.h". * edit-context.h (class fixit_hint): New forward decl. * gcc-rich-location.h: Include "rich-location.h". * genmatch.cc: Likewise. * pretty-print.h: Likewise. gcc/rust/ChangeLog: * rust-location.h: Include "rich-location.h". libcpp/ChangeLog: * Makefile.in (TAGS_SOURCES): Add "include/rich-location.h". * include/cpplib.h (class rich_location): New forward decl. * include/line-map.h (class range_label) (enum range_display_kind, struct location_range) (class semi_embedded_vec, class rich_location, class label_text) (class range_label, class fixit_hint): Move to... * include/rich-location.h: ...this new file. * internal.h: Include "rich-location.h". Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/Makefile.in1
-rw-r--r--gcc/analyzer/analyzer.h1
-rw-r--r--gcc/c-family/c-lex.cc1
-rw-r--r--gcc/coretypes.h1
-rw-r--r--gcc/cp/mapper-client.cc1
-rw-r--r--gcc/diagnostic.h1
-rw-r--r--gcc/edit-context.h1
-rw-r--r--gcc/gcc-rich-location.h2
-rw-r--r--gcc/genmatch.cc1
-rw-r--r--gcc/pretty-print.h1
-rw-r--r--gcc/rust/rust-location.h1
11 files changed, 12 insertions, 0 deletions
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 7228b79..753f2f3 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1038,6 +1038,7 @@ SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h \
$(HASHTAB_H)
PREDICT_H = predict.h predict.def
CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \
+ $(srcdir)/../libcpp/include/rich-location.h \
$(srcdir)/../libcpp/include/cpplib.h
CODYLIB_H = $(srcdir)/../libcody/cody.hh
INPUT_H = $(srcdir)/../libcpp/include/line-map.h input.h
diff --git a/gcc/analyzer/analyzer.h b/gcc/analyzer/analyzer.h
index f08572b..cf32d4b 100644
--- a/gcc/analyzer/analyzer.h
+++ b/gcc/analyzer/analyzer.h
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_ANALYZER_ANALYZER_H
#define GCC_ANALYZER_ANALYZER_H
+#include "rich-location.h"
#include "function.h"
#include "json.h"
#include "tristate.h"
diff --git a/gcc/c-family/c-lex.cc b/gcc/c-family/c-lex.cc
index 06c2453..86ec679 100644
--- a/gcc/c-family/c-lex.cc
+++ b/gcc/c-family/c-lex.cc
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "file-prefix-map.h" /* remap_macro_filename() */
#include "langhooks.h"
#include "attribs.h"
+#include "rich-location.h"
/* We may keep statistics about how long which files took to compile. */
static int header_time, body_time;
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 9848cde..fe5b868 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -156,6 +156,7 @@ struct cl_optimization;
struct cl_option;
struct cl_decoded_option;
struct cl_option_handlers;
+class rich_location;
class diagnostic_context;
class pretty_printer;
class diagnostic_event_id_t;
diff --git a/gcc/cp/mapper-client.cc b/gcc/cp/mapper-client.cc
index 9272719..f1a0c4c 100644
--- a/gcc/cp/mapper-client.cc
+++ b/gcc/cp/mapper-client.cc
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "line-map.h"
+#include "rich-location.h"
#include "diagnostic-core.h"
#include "mapper-client.h"
#include "intl.h"
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index dbf972d..cbd2554 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_DIAGNOSTIC_H
#define GCC_DIAGNOSTIC_H
+#include "rich-location.h"
#include "pretty-print.h"
#include "diagnostic-core.h"
diff --git a/gcc/edit-context.h b/gcc/edit-context.h
index 3ae9ba1..71735c8 100644
--- a/gcc/edit-context.h
+++ b/gcc/edit-context.h
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "typed-splay-tree.h"
+class fixit_hint;
class edit_context;
class edited_file;
diff --git a/gcc/gcc-rich-location.h b/gcc/gcc-rich-location.h
index ffba4b8..e42daa4 100644
--- a/gcc/gcc-rich-location.h
+++ b/gcc/gcc-rich-location.h
@@ -20,6 +20,8 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_RICH_LOCATION_H
#define GCC_RICH_LOCATION_H
+#include "rich-location.h"
+
/* A gcc_rich_location is libcpp's rich_location with additional
helper methods for working with gcc's types. The class is not
copyable or assignable because rich_location isn't. */
diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc
index 3488764..98268ee 100644
--- a/gcc/genmatch.cc
+++ b/gcc/genmatch.cc
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include <cpplib.h>
+#include "rich-location.h"
#include "errors.h"
#include "hash-table.h"
#include "hash-set.h"
diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h
index 9ba2c0a..138c582 100644
--- a/gcc/pretty-print.h
+++ b/gcc/pretty-print.h
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#define GCC_PRETTY_PRINT_H
#include "obstack.h"
+#include "rich-location.h"
#include "diagnostic-url.h"
/* Maximum number of format string arguments. */
diff --git a/gcc/rust/rust-location.h b/gcc/rust/rust-location.h
index 9cb29b2..873b40f 100644
--- a/gcc/rust/rust-location.h
+++ b/gcc/rust/rust-location.h
@@ -21,6 +21,7 @@
#ifndef RUST_LOCATION_H
#define RUST_LOCATION_H
+#include "rich-location.h"
#include "rust-system.h"
// A location in an input source file.