aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-ast.h
diff options
context:
space:
mode:
authorSimplyTheOther <simplytheother@gmail.com>2020-11-29 22:47:31 +0800
committerSimplyTheOther <simplytheother@gmail.com>2020-12-08 21:10:34 +0800
commitdb39766514144dbbad34d9db3977c3a72d1216c3 (patch)
treec7c470e4bf94ccb0105f8ad80ff85c7582ee9358 /gcc/rust/ast/rust-ast.h
parent9b252167a77316750f34c455222e5f30724e51e4 (diff)
downloadgcc-db39766514144dbbad34d9db3977c3a72d1216c3.zip
gcc-db39766514144dbbad34d9db3977c3a72d1216c3.tar.gz
gcc-db39766514144dbbad34d9db3977c3a72d1216c3.tar.bz2
Added new pattern stripping
Fixed get_locus_slow call in StructPatternField compile error Added and improved cfg stripping Fixed compilation errors
Diffstat (limited to 'gcc/rust/ast/rust-ast.h')
-rw-r--r--gcc/rust/ast/rust-ast.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index c186f22..b5e56ba 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -968,6 +968,14 @@ public:
virtual void accept_vis (ASTVisitor &vis) = 0;
+ // as only one kind of pattern can be stripped, have default of nothing
+ virtual void mark_for_strip () {}
+ virtual bool is_marked_for_strip () const { return false; }
+
+ /* HACK: slow way of getting location from base expression through virtual
+ * methods. */
+ virtual Location get_locus_slow () const = 0;
+
protected:
// Clone pattern implementation as pure virtual method
virtual Pattern *clone_pattern_impl () const = 0;
@@ -1002,6 +1010,12 @@ public:
virtual void accept_vis (ASTVisitor &vis) = 0;
+ // as only two kinds of types can be stripped, have default of nothing
+ virtual void mark_for_strip () {}
+ virtual bool is_marked_for_strip () const { return false; }
+
+ virtual Location get_locus_slow () const = 0;
+
protected:
// Clone function implementation as pure virtual method
virtual Type *clone_type_impl () const = 0;
@@ -1081,7 +1095,7 @@ public:
{}
// Creates an "error" lifetime.
- static Lifetime error () { return Lifetime (NAMED, std::string ("")); }
+ static Lifetime error () { return Lifetime (NAMED, ""); }
// Returns true if the lifetime is in an error state.
bool is_error () const