public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Arthur Cohen <cohenarthur@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-7940] gccrs: Namespace related tweaks
Date: Tue, 16 Jan 2024 18:09:08 +0000 (GMT)	[thread overview]
Message-ID: <20240116180908.91CE03857B83@sourceware.org> (raw)

https://gcc.gnu.org/g:d429c4ac2d8dbf727a05baa5f7a6169e39246811

commit r14-7940-gd429c4ac2d8dbf727a05baa5f7a6169e39246811
Author: Owen Avery <powerboat9.gamer@gmail.com>
Date:   Sat Aug 19 13:13:21 2023 -0400

    gccrs: Namespace related tweaks
    
    gcc/rust/ChangeLog:
    
            * backend/rust-tree.cc
            (Rust::gt_pch_nx): Move external function declaration ...
            (gt_pch_nx): ... out of Rust namespace.
            * backend/rust-tree.h
            (OVL_FIRST): Qualify function name.
    
    Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>

Diff:
---
 gcc/rust/backend/rust-tree.cc | 19 ++++++++++++-------
 gcc/rust/backend/rust-tree.h  |  2 +-
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/gcc/rust/backend/rust-tree.cc b/gcc/rust/backend/rust-tree.cc
index d1277ffd8ca..6d4f344a20a 100644
--- a/gcc/rust/backend/rust-tree.cc
+++ b/gcc/rust/backend/rust-tree.cc
@@ -4247,6 +4247,17 @@ struct GTY ((for_user)) source_location_table_entry
   tree var;
 };
 
+// exit/reenter namespace to declare some external functions
+
+} // namespace Rust
+
+extern void
+gt_pch_nx (Rust::source_location_table_entry &);
+extern void
+gt_pch_nx (Rust::source_location_table_entry *, gt_pointer_operator, void *);
+
+namespace Rust {
+
 /* Traits class for function start hash maps below.  */
 
 struct source_location_table_entry_hash
@@ -4297,17 +4308,11 @@ struct source_location_table_entry_hash
 	    && ref.var == NULL_TREE);
   }
 
-  static void pch_nx (source_location_table_entry &p)
-  {
-    extern void gt_pch_nx (source_location_table_entry &);
-    gt_pch_nx (p);
-  }
+  static void pch_nx (source_location_table_entry &p) { gt_pch_nx (p); }
 
   static void pch_nx (source_location_table_entry &p, gt_pointer_operator op,
 		      void *cookie)
   {
-    extern void gt_pch_nx (source_location_table_entry *, gt_pointer_operator,
-			   void *);
     gt_pch_nx (&p, op, cookie);
   }
 };
diff --git a/gcc/rust/backend/rust-tree.h b/gcc/rust/backend/rust-tree.h
index 38e7393983b..e1b44a1ee43 100644
--- a/gcc/rust/backend/rust-tree.h
+++ b/gcc/rust/backend/rust-tree.h
@@ -609,7 +609,7 @@ extern GTY (()) tree cp_global_trees[CPTI_MAX];
 #define OVL_EXPORT_P(NODE) TREE_LANG_FLAG_5 (OVERLOAD_CHECK (NODE))
 
 /* The first decl of an overload.  */
-#define OVL_FIRST(NODE) ovl_first (NODE)
+#define OVL_FIRST(NODE) Rust::ovl_first (NODE)
 /* The name of the overload set.  */
 #define OVL_NAME(NODE) DECL_NAME (OVL_FIRST (NODE))

                 reply	other threads:[~2024-01-16 18:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240116180908.91CE03857B83@sourceware.org \
    --to=cohenarthur@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).