diff options
author | SimplyTheOther <simplytheother@gmail.com> | 2020-12-07 19:51:24 +0800 |
---|---|---|
committer | SimplyTheOther <simplytheother@gmail.com> | 2020-12-08 21:10:36 +0800 |
commit | c7080f178a637cad04e196a404d5d44bb33189af (patch) | |
tree | a023eeee3f2c3ab85190e4967cfe0599b466843e /gcc/rust/ast/rust-pattern.h | |
parent | db39766514144dbbad34d9db3977c3a72d1216c3 (diff) | |
download | gcc-c7080f178a637cad04e196a404d5d44bb33189af.zip gcc-c7080f178a637cad04e196a404d5d44bb33189af.tar.gz gcc-c7080f178a637cad04e196a404d5d44bb33189af.tar.bz2 |
Added more cfg stripping code
Diffstat (limited to 'gcc/rust/ast/rust-pattern.h')
-rw-r--r-- | gcc/rust/ast/rust-pattern.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-pattern.h b/gcc/rust/ast/rust-pattern.h index 5dd0429..5ae68ab 100644 --- a/gcc/rust/ast/rust-pattern.h +++ b/gcc/rust/ast/rust-pattern.h @@ -223,6 +223,10 @@ public: void accept_vis (ASTVisitor &vis) override; + // TODO: this mutable getter seems kinda dodgy + PathInExpression &get_path () { return path; } + const PathInExpression &get_path () const { return path; } + protected: /* Use covariance to implement clone function as returning this object rather * than base */ @@ -251,6 +255,10 @@ public: void accept_vis (ASTVisitor &vis) override; + // TODO: this mutable getter seems kinda dodgy + QualifiedPathInExpression &get_qualified_path () { return path; } + const QualifiedPathInExpression &get_qualified_path () const { return path; } + protected: /* Use covariance to implement clone function as returning this object rather * than base */ @@ -310,6 +318,17 @@ public: void accept_vis (ASTVisitor &vis) override; + // TODO: is this better? or is a "vis_bound" better? + std::unique_ptr<RangePatternBound>& get_lower_bound () { + rust_assert (lower != nullptr); + return lower; + } + + std::unique_ptr<RangePatternBound>& get_upper_bound () { + rust_assert (upper != nullptr); + return upper; + } + protected: /* Use covariance to implement clone function as returning this object rather * than base */ @@ -735,6 +754,9 @@ public: StructPatternElements &get_struct_pattern_elems () { return elems; } const StructPatternElements &get_struct_pattern_elems () const { return elems; } + PathInExpression &get_path () { return path; } + const PathInExpression &get_path () const { return path; } + protected: /* Use covariance to implement clone function as returning this object rather * than base */ @@ -940,6 +962,9 @@ public: return items; } + PathInExpression &get_path () { return path; } + const PathInExpression &get_path () const { return path; } + protected: /* Use covariance to implement clone function as returning this object rather * than base */ |