aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2023-08-18 17:01:34 -0400
committerPhilip Herron <philip.herron@embecosm.com>2023-08-31 10:35:29 +0000
commita8876144d7df90baa11c3fe59764c8796e977b16 (patch)
treea561e517052992a2063d3042df7716aed4f8868b /gcc
parent16939cc6458c196efba1705559de13d22f2299a1 (diff)
downloadgcc-a8876144d7df90baa11c3fe59764c8796e977b16.zip
gcc-a8876144d7df90baa11c3fe59764c8796e977b16.tar.gz
gcc-a8876144d7df90baa11c3fe59764c8796e977b16.tar.bz2
Handle gengtype annotations in backend/rust-tree.{cc,h}
gcc/rust/ChangeLog: * config-lang.in: Add "backend/rust-tree.h" and "backend/rust-tree.h" to gtfiles. * backend/rust-tree.cc: Include new header generated by gengtype. * backend/rust-tree.h (struct language_function): Add TODO. * rust-lang.cc: Include "rust-tree.h". (struct lang_type): Remove duplicate definition. (struct lang_decl): Likewise. (struct lang_identifier): Likewise. (struct language_function): Likewise. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/backend/rust-tree.cc4
-rw-r--r--gcc/rust/backend/rust-tree.h3
-rw-r--r--gcc/rust/config-lang.in5
-rw-r--r--gcc/rust/rust-lang.cc23
4 files changed, 11 insertions, 24 deletions
diff --git a/gcc/rust/backend/rust-tree.cc b/gcc/rust/backend/rust-tree.cc
index 096a7d8..45e0a79 100644
--- a/gcc/rust/backend/rust-tree.cc
+++ b/gcc/rust/backend/rust-tree.cc
@@ -6210,3 +6210,7 @@ array_string_literal_compatible_p (tree type, tree init)
}
} // namespace Rust
+
+using namespace Rust;
+
+#include "gt-rust-rust-tree.h"
diff --git a/gcc/rust/backend/rust-tree.h b/gcc/rust/backend/rust-tree.h
index 93c908c..fc48aa0 100644
--- a/gcc/rust/backend/rust-tree.h
+++ b/gcc/rust/backend/rust-tree.h
@@ -2289,7 +2289,8 @@ struct rust_named_label_hash : ggc_remove<rust_named_label_entry *>
// forked from gcc/cp/cp-tree.h
-/* Global state pertinent to the current function. */
+/* Global state pertinent to the current function.
+ TODO: remove vestigial fields */
struct GTY (()) language_function
{
diff --git a/gcc/rust/config-lang.in b/gcc/rust/config-lang.in
index 5bc6636..da8b5e3 100644
--- a/gcc/rust/config-lang.in
+++ b/gcc/rust/config-lang.in
@@ -31,4 +31,7 @@ build_by_default="no"
target_libs="target-libgrust"
-gtfiles="\$(srcdir)/rust/rust-lang.cc \$(srcdir)/rust/backend/rust-constexpr.cc"
+gtfiles="\
+\$(srcdir)/rust/rust-lang.cc \$(srcdir)/rust/backend/rust-constexpr.cc \
+\$(srcdir)/rust/backend/rust-tree.h \$(srcdir)/rust/backend/rust-tree.cc \
+"
diff --git a/gcc/rust/rust-lang.cc b/gcc/rust/rust-lang.cc
index e544d03..d453eac 100644
--- a/gcc/rust/rust-lang.cc
+++ b/gcc/rust/rust-lang.cc
@@ -68,23 +68,7 @@
#include "rust-system.h"
#include "rust-session-manager.h"
-
-// Language-dependent contents of a type. GTY() mark used for garbage collector.
-struct GTY (()) lang_type
-{
-};
-
-// Language-dependent contents of a decl.
-struct GTY (()) lang_decl
-{
-};
-
-// Language-dependent contents of an identifier. This must include a
-// tree_identifier.
-struct GTY (()) lang_identifier
-{
- struct tree_identifier common;
-};
+#include "rust-tree.h"
// The resulting tree type.
union GTY ((
@@ -98,11 +82,6 @@ union GTY ((
struct lang_identifier GTY ((tag ("1"))) identifier;
};
-// We don't use language_function.
-struct GTY (()) language_function
-{
-};
-
// has to be in same compilation unit as session, so here for now
void
rust_add_target_info (const char *key, const char *value)