]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Remove NodeId member from Identifier
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 13 Jul 2023 12:50:38 +0000 (14:50 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:56:00 +0000 (18:56 +0100)
Remove the NodeId member from identifiers. This member did not make
sense and was solely used for procedural macros.

gcc/rust/ChangeLog:

* ast/rust-ast.h: Remove NodeId from identifiers.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast.h

index 3f154ef436238eb339a1955a89d893eed1f92a44..7c2e1224a236e65d88e8757a83d52c2268b15061 100644 (file)
@@ -36,20 +36,14 @@ class Identifier
 {
 public:
   // Create dummy identifier
-  Identifier ()
-    : ident (""), node_id (Analysis::Mappings::get ()->get_next_node_id ()),
-      loc (UNDEF_LOCATION)
-  {}
+  Identifier () : ident (""), loc (UNDEF_LOCATION) {}
   // Create identifier with dummy location
   Identifier (std::string ident, location_t loc = UNDEF_LOCATION)
-    : ident (ident), node_id (Analysis::Mappings::get ()->get_next_node_id ()),
-      loc (loc)
+    : ident (ident), loc (loc)
   {}
   // Create identifier from token
   Identifier (const_TokenPtr token)
-    : ident (token->get_str ()),
-      node_id (Analysis::Mappings::get ()->get_next_node_id ()),
-      loc (token->get_locus ())
+    : ident (token->get_str ()), loc (token->get_locus ())
   {}
 
   Identifier (const Identifier &) = default;
@@ -57,7 +51,6 @@ public:
   Identifier &operator= (const Identifier &) = default;
   Identifier &operator= (Identifier &&) = default;
 
-  NodeId get_node_id () const { return node_id; }
   location_t get_locus () const { return loc; }
   const std::string &as_string () const { return ident; }
 
@@ -65,7 +58,6 @@ public:
 
 private:
   std::string ident;
-  NodeId node_id;
   location_t loc;
 };