]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Handle gengtype annotations in backend/rust-tree.{cc,h}
authorOwen Avery <powerboat9.gamer@gmail.com>
Fri, 18 Aug 2023 21:01:34 +0000 (17:01 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:00:34 +0000 (19:00 +0100)
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>
gcc/rust/backend/rust-tree.cc
gcc/rust/backend/rust-tree.h
gcc/rust/config-lang.in
gcc/rust/rust-lang.cc

index 16023ff322c6e0fc763ac949c9c0f3f8e7b0767b..2a5ffcbf895606dac06ee2d049ef02ebc18700bd 100644 (file)
@@ -6207,3 +6207,7 @@ array_string_literal_compatible_p (tree type, tree init)
 }
 
 } // namespace Rust
+
+using namespace Rust;
+
+#include "gt-rust-rust-tree.h"
index dd3b611d53f4cb80a2c553febc4269bce69e7230..26c8b653ac64dd36b12e68411e31e5b36d18ebb0 100644 (file)
@@ -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
 {
index 3e9af1cc7c8d291cf03358b28ee15ee58cc9779e..6221ff45128663ca895138b93f731452f5f3a629 100644 (file)
@@ -32,4 +32,7 @@ build_by_default="no"
 target_libs="target-libgrust"
 lang_dirs=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 \
+"
index 6d40cc0697df3e9785b4a5c09880f703a6992ee8..f9bec3f7c1e109b26908c7072472a69a8bae6cff 100644 (file)
  */
 
 #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 ((
@@ -95,11 +79,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)