diff options
-rw-r--r-- | gcc/rust/ast/rust-ast.h | 4 | ||||
-rw-r--r-- | gcc/rust/ast/rust-item.h | 4 | ||||
-rw-r--r-- | gcc/rust/ast/rust-stmt.h | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 7e85fb3..9ad2c4c 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -804,6 +804,10 @@ public: virtual void accept_vis (ASTVisitor &vis) = 0; + // HACK: slow way of getting location from base expression through virtual + // methods. + virtual Location get_locus_slow () const { return Location (); } + protected: // Clone function implementation as pure virtual method virtual Stmt *clone_stmt_impl () const = 0; diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h index cfcb5ee..e8eb215 100644 --- a/gcc/rust/ast/rust-item.h +++ b/gcc/rust/ast/rust-item.h @@ -1306,6 +1306,8 @@ protected: ::std::vector<FunctionParam> function_params; };*/ +class LetStmt; + // Rust function declaration AST node class Function : public VisItem, public InherentImplItem, public TraitImplItem { @@ -1334,6 +1336,8 @@ public: Location locus; + ::std::vector<LetStmt *> locals; + /*~Function() { delete function_body; }*/ diff --git a/gcc/rust/ast/rust-stmt.h b/gcc/rust/ast/rust-stmt.h index f19ba2c..addb5f9 100644 --- a/gcc/rust/ast/rust-stmt.h +++ b/gcc/rust/ast/rust-stmt.h @@ -213,6 +213,8 @@ public: ::std::string as_string () const; + ::std::vector<LetStmt *> locals; + ExprStmtWithBlock (::std::unique_ptr<ExprWithBlock> expr, Location locus) : ExprStmt (locus), expr (::std::move (expr)) {} |