[committed,16/88] gccrs: Add get_item method for HIR::GroupedPattern

Message ID 20230405140411.3016563-17-arthur.cohen@embecosm.com
State Accepted
Headers
Series [committed,01/88] gccrs: fatal_error_flag: Fix typo in error message |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Arthur Cohen April 5, 2023, 2:03 p.m. UTC
  From: Owen Avery <powerboat9.gamer@gmail.com>

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 | 6 ++++++
 1 file changed, 6 insertions(+)
  

Patch

diff --git a/gcc/rust/hir/tree/rust-hir-pattern.h b/gcc/rust/hir/tree/rust-hir-pattern.h
index 80fa9b791a7..b7a230c526f 100644
--- a/gcc/rust/hir/tree/rust-hir-pattern.h
+++ b/gcc/rust/hir/tree/rust-hir-pattern.h
@@ -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 */