diff options
author | Philip Herron <philip.herron@embecosm.com> | 2020-12-03 15:34:15 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2020-12-03 17:25:24 +0000 |
commit | 064c6e4815b212d72f008082939376f570897c19 (patch) | |
tree | 4090d53e54ea8565d9515b3668f432306a2ee697 /gcc/rust/ast/rust-expr.h | |
parent | 03fc0e389fae2576a7f217fb0afb7cb0f18689f8 (diff) | |
download | gcc-064c6e4815b212d72f008082939376f570897c19.zip gcc-064c6e4815b212d72f008082939376f570897c19.tar.gz gcc-064c6e4815b212d72f008082939376f570897c19.tar.bz2 |
Type Resolve ReturnExpr's to ensure they match the function type.
This an implementation to check return types for functions it needs work
to handle structs and other data structures later on.
Diffstat (limited to 'gcc/rust/ast/rust-expr.h')
-rw-r--r-- | gcc/rust/ast/rust-expr.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h index 4971041..f587c00 100644 --- a/gcc/rust/ast/rust-expr.h +++ b/gcc/rust/ast/rust-expr.h @@ -3012,11 +3012,11 @@ protected: // Return expression AST node representation class ReturnExpr : public ExprWithoutBlock { -public: std::unique_ptr<Expr> return_expr; Location locus; +public: std::string as_string () const override; /* Returns whether the object has an expression returned (i.e. not void return @@ -3059,6 +3059,8 @@ public: void accept_vis (ASTVisitor &vis) override; + Expr *get_expr () { return return_expr.get (); } + protected: /* Use covariance to implement clone function as returning this object rather * than base */ |