diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-12-16 12:04:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-16 12:04:43 +0000 |
commit | 8507a68883438060b3b8e828069ffe20a084b85a (patch) | |
tree | e8696aabec33a96923587fe9bed2bbcb31a562a2 /gcc/rust/hir | |
parent | 7615df781226137b9cd76b47df4aea6ad9f2140e (diff) | |
parent | 3a8c585300517fe5bd95bb0dc29520871183193b (diff) | |
download | gcc-8507a68883438060b3b8e828069ffe20a084b85a.zip gcc-8507a68883438060b3b8e828069ffe20a084b85a.tar.gz gcc-8507a68883438060b3b8e828069ffe20a084b85a.tar.bz2 |
Merge #837
837: HIR::IdentifierPattern had all fields public r=philberty a=philberty
This makes the fields private again and adds the missing getter for the
identifier.
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/hir')
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-pattern.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-pattern.h b/gcc/rust/hir/tree/rust-hir-pattern.h index 1373cc7..bdeeaed 100644 --- a/gcc/rust/hir/tree/rust-hir-pattern.h +++ b/gcc/rust/hir/tree/rust-hir-pattern.h @@ -68,16 +68,13 @@ protected: // Identifier pattern HIR node (bind value matched to a variable) class IdentifierPattern : public Pattern { -public: Identifier variable_ident; bool is_ref; Mutability mut; - - // bool has_pattern; std::unique_ptr<Pattern> to_bind; - Location locus; +public: std::string as_string () const override; // Returns whether the IdentifierPattern has a pattern to bind. @@ -126,6 +123,8 @@ public: void accept_vis (HIRVisitor &vis) override; + Identifier get_identifier () const { return variable_ident; } + protected: /* Use covariance to implement clone function as returning this object rather * than base */ |