]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Replace get_pattern_node_id with get_node_id
authorOwen Avery <powerboat9.gamer@gmail.com>
Wed, 11 Oct 2023 02:50:55 +0000 (22:50 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:09:14 +0000 (19:09 +0100)
gcc/rust/ChangeLog:

* ast/rust-ast.h
(Pattern::get_pattern_node_id): Rename to...
(Pattern::get_node_id): ...here.
* ast/rust-macro.h
(MacroInvocation::get_pattern_node_id): Rename to...
(MacroInvocation::get_node_id): ...here.
* ast/rust-path.h
(PathInExpression::get_pattern_node_id): Remove.
(QualifiedPathInExpression::get_pattern_node_id): Remove.
* ast/rust-pattern.h
(LiteralPattern::get_pattern_node_id): Remove.
(IdentifierPattern::get_pattern_node_id): Remove.
(WildcardPattern::get_pattern_node_id): Remove.
(RestPattern::get_pattern_node_id): Rename to...
(RestPattern::get_node_id): ...here.
(RangePattern::get_pattern_node_id): Remove.
(ReferencePattern::get_pattern_node_id): Remove.
(StructPattern::get_pattern_node_id): Remove.
(TupleStructPattern::get_pattern_node_id): Remove.
(TuplePattern::get_pattern_node_id): Remove.
(GroupedPattern::get_pattern_node_id): Remove.
(SlicePattern::get_pattern_node_id): Remove.
(AltPattern::get_pattern_node_id): Remove.
* resolve/rust-early-name-resolver.cc
(EarlyNameResolver::visit):
Use get_node_id instead of get_pattern_node_id.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/ast/rust-ast.h
gcc/rust/ast/rust-macro.h
gcc/rust/ast/rust-path.h
gcc/rust/ast/rust-pattern.h
gcc/rust/resolve/rust-early-name-resolver.cc

index 136da86525d9d3b4f07968f7c8e607ab97dfd039..b39d3cc136407db9834ee819ea36053101c14dbc 100644 (file)
@@ -1194,7 +1194,7 @@ public:
   virtual bool is_marked_for_strip () const { return false; }
 
   virtual location_t get_locus () const = 0;
-  virtual NodeId get_pattern_node_id () const = 0;
+  virtual NodeId get_node_id () const = 0;
 
 protected:
   // Clone pattern implementation as pure virtual method
index 490e8121427e26b71e104fd61668354becbad9ef..435ecb118150113460d56aa40f4a6bc090561b7f 100644 (file)
@@ -668,7 +668,7 @@ public:
     outer_attrs = std::move (new_attrs);
   }
 
-  NodeId get_pattern_node_id () const override final
+  NodeId get_node_id () const override final
   {
     return ExprWithoutBlock::get_node_id ();
   }
index 14524c7624c289300f79cdd7363f754b4218ad72..9279fdd8c7dd262d549c5f15c232c31f28c55e33 100644 (file)
@@ -644,8 +644,6 @@ public:
     outer_attrs = std::move (new_attrs);
   }
 
-  NodeId get_pattern_node_id () const override final { return get_node_id (); }
-
 protected:
   /* Use covariance to implement clone function as returning this object
    * rather than base */
@@ -1244,8 +1242,6 @@ public:
 
   NodeId get_node_id () const override { return _node_id; }
 
-  NodeId get_pattern_node_id () const override final { return get_node_id (); }
-
 protected:
   /* Use covariance to implement clone function as returning this object
    * rather than base */
index 18fe99957901d574b61cf3a7c6eb472226a553aa..6ee1417a1fd68154a4c29da29b94a30011381e84 100644 (file)
@@ -51,8 +51,6 @@ public:
 
   NodeId get_node_id () const { return node_id; }
 
-  NodeId get_pattern_node_id () const override final { return node_id; }
-
   Literal &get_literal () { return lit; }
 
   const Literal &get_literal () const { return lit; }
@@ -151,8 +149,6 @@ public:
 
   NodeId get_node_id () const { return node_id; }
 
-  NodeId get_pattern_node_id () const override final { return node_id; }
-
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -181,8 +177,6 @@ public:
 
   NodeId get_node_id () const { return node_id; }
 
-  NodeId get_pattern_node_id () const override final { return node_id; }
-
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -208,7 +202,7 @@ public:
 
   void accept_vis (ASTVisitor &vis) override;
 
-  NodeId get_pattern_node_id () const override final { return node_id; }
+  NodeId get_node_id () const override final { return node_id; }
 
 protected:
   RestPattern *clone_pattern_impl () const override
@@ -437,8 +431,6 @@ public:
 
   NodeId get_node_id () const { return node_id; }
 
-  NodeId get_pattern_node_id () const override final { return node_id; }
-
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -507,8 +499,6 @@ public:
 
   NodeId get_node_id () const { return node_id; }
 
-  NodeId get_pattern_node_id () const override final { return node_id; }
-
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -944,8 +934,6 @@ public:
 
   NodeId get_node_id () const { return node_id; }
 
-  NodeId get_pattern_node_id () const override final { return node_id; }
-
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -1183,8 +1171,6 @@ public:
 
   NodeId get_node_id () const { return node_id; }
 
-  NodeId get_pattern_node_id () const override final { return node_id; }
-
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -1425,8 +1411,6 @@ public:
 
   NodeId get_node_id () const { return node_id; }
 
-  NodeId get_pattern_node_id () const override final { return node_id; }
-
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -1487,8 +1471,6 @@ public:
 
   NodeId get_node_id () const { return node_id; }
 
-  NodeId get_pattern_node_id () const override final { return node_id; }
-
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -1553,8 +1535,6 @@ public:
 
   NodeId get_node_id () const { return node_id; }
 
-  NodeId get_pattern_node_id () const override final { return node_id; }
-
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
@@ -1620,8 +1600,6 @@ public:
 
   NodeId get_node_id () const { return node_id; }
 
-  NodeId get_pattern_node_id () const override final { return node_id; }
-
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */
index cdebca6389298c5b2f8d7967b839a7e9beb7b35c..63d3ccfb74ffd6e63a1184ed98197c30414214ef 100644 (file)
@@ -953,7 +953,7 @@ EarlyNameResolver::visit (AST::MacroInvocation &invoc)
   if (has_semicolon)
     source_node = invoc.get_macro_node_id ();
   else
-    source_node = invoc.get_pattern_node_id ();
+    source_node = invoc.get_node_id ();
   auto seg
     = CanonicalPath::new_seg (source_node, invoc_data.get_path ().as_string ());