gccrs: Add get_item method for HIR::GroupedPattern
authorOwen Avery <powerboat9.gamer@gmail.com>
Wed, 25 Jan 2023 18:00:38 +0000 (13:00 -0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 6 Apr 2023 08:47:18 +0000 (10:47 +0200)
gcc/rust/ChangeLog:

* hir/tree/rust-hir-pattern.h: Add get_item method.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/hir/tree/rust-hir-pattern.h

index 80fa9b791a7d0e016706fa3763192a688efaa58a..b7a230c526f5118eb4cabf9f2d6c15f46724f1ef 100644 (file)
@@ -1269,6 +1269,12 @@ public:
     return PatternType::GROUPED;
   }
 
+  std::unique_ptr<Pattern> &get_item () { return pattern_in_parens; }
+  const std::unique_ptr<Pattern> &get_item () const
+  {
+    return pattern_in_parens;
+  }
+
 protected:
   /* Use covariance to implement clone function as returning this object rather
    * than base */