diff options
-rw-r--r-- | gcc/rust/analysis/rust-type-resolution.cc | 2 | ||||
-rw-r--r-- | gcc/rust/ast/rust-expr.h | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/analysis/rust-type-resolution.cc b/gcc/rust/analysis/rust-type-resolution.cc index 0045420..48ea699 100644 --- a/gcc/rust/analysis/rust-type-resolution.cc +++ b/gcc/rust/analysis/rust-type-resolution.cc @@ -439,11 +439,13 @@ TypeResolution::visit (AST::EnumExprFieldless &expr) void TypeResolution::visit (AST::CallExpr &expr) { + // this look up should probably be moved to name resolution auto fndecl = lookupFndecl (expr.function.get ()); if (fndecl == NULL) return; typeBuffer.push_back (fndecl->return_type.get ()); + expr.fndeclRef = fndecl; auto before = typeBuffer.size (); for (auto &item : expr.params) diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h index e0f9536..827ca0d 100644 --- a/gcc/rust/ast/rust-expr.h +++ b/gcc/rust/ast/rust-expr.h @@ -23,6 +23,7 @@ class Statement;*/ // decls no longer required as definitions moved to rust-ast. // Decl as definition moved to rust-ast.h class ExprWithoutBlock; +class Function; // AST node for an expression with an accompanying block - abstract class ExprWithBlock : public Expr @@ -2534,6 +2535,8 @@ public: Location locus; + Function *fndeclRef; + /*~CallExpr() { delete function; }*/ |