public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-7947] gccrs: Handle gengtype annotations in backend/rust-tree.{cc, h}
@ 2024-01-16 18:09 Arthur Cohen
  0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-16 18:09 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:9048f08f4e94594b837290ac26f3a5bbeb47f2c3

commit r14-7947-g9048f08f4e94594b837290ac26f3a5bbeb47f2c3
Author: Owen Avery <powerboat9.gamer@gmail.com>
Date:   Fri Aug 18 17:01:34 2023 -0400

    gccrs: 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>

Diff:
---
 gcc/rust/backend/rust-tree.cc |  4 ++++
 gcc/rust/backend/rust-tree.h  |  3 ++-
 gcc/rust/config-lang.in       |  5 ++++-
 gcc/rust/rust-lang.cc         | 23 +----------------------
 4 files changed, 11 insertions(+), 24 deletions(-)

diff --git a/gcc/rust/backend/rust-tree.cc b/gcc/rust/backend/rust-tree.cc
index 16023ff322c..2a5ffcbf895 100644
--- a/gcc/rust/backend/rust-tree.cc
+++ b/gcc/rust/backend/rust-tree.cc
@@ -6207,3 +6207,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 dd3b611d53f..26c8b653ac6 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 3e9af1cc7c8..6221ff45128 100644
--- a/gcc/rust/config-lang.in
+++ b/gcc/rust/config-lang.in
@@ -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 \
+"
diff --git a/gcc/rust/rust-lang.cc b/gcc/rust/rust-lang.cc
index 6d40cc0697d..f9bec3f7c1e 100644
--- a/gcc/rust/rust-lang.cc
+++ b/gcc/rust/rust-lang.cc
@@ -65,23 +65,7 @@
  */
 
 #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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-16 18:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 18:09 [gcc r14-7947] gccrs: Handle gengtype annotations in backend/rust-tree.{cc, h} Arthur Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).