]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Namespace related tweaks
authorOwen Avery <powerboat9.gamer@gmail.com>
Sat, 19 Aug 2023 17:13:21 +0000 (13:13 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:00:33 +0000 (19:00 +0100)
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>
gcc/rust/backend/rust-tree.cc
gcc/rust/backend/rust-tree.h

index d1277ffd8ca60f457fdd53cf71bf1a91f0ec87d3..6d4f344a20a3918583fcf48c5c5e04704f5025f8 100644 (file)
@@ -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);
   }
 };
index 38e7393983b463d3f58932725cb9e2f2d9c74a7c..e1b44a1ee437851d2c20d13cb92c5b9cf91369c0 100644 (file)
@@ -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))