From 777e7e0a3d5241e83ff18fdb7753ccd6d5c68caa Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 22 Jan 2015 17:04:23 +0100 Subject: [PATCH] vhdlpp: Added ExpFunc::func_ret_type() method. --- vhdlpp/expression.cc | 6 ++++++ vhdlpp/expression.h | 1 + 2 files changed, 7 insertions(+) diff --git a/vhdlpp/expression.cc b/vhdlpp/expression.cc index f0e7ee25b..063063772 100644 --- a/vhdlpp/expression.cc +++ b/vhdlpp/expression.cc @@ -20,6 +20,7 @@ */ # include "expression.h" +# include "subprogram.h" # include "parse_types.h" # include "scope.h" # include @@ -283,6 +284,11 @@ ExpFunc::~ExpFunc() delete argv_[idx]; } +const VType* ExpFunc::func_ret_type() const +{ + return def_->peek_return_type(); +} + ExpInteger::ExpInteger(int64_t val) : value_(val) { diff --git a/vhdlpp/expression.h b/vhdlpp/expression.h index 28ab2b16f..b5b5f5c0a 100644 --- a/vhdlpp/expression.h +++ b/vhdlpp/expression.h @@ -477,6 +477,7 @@ class ExpFunc : public Expression { inline perm_string func_name() const { return name_; } inline size_t func_args() const { return argv_.size(); } inline const Expression*func_arg(size_t idx) const { return argv_[idx]; } + const VType*func_ret_type() const; public: // Base methods int elaborate_expr(Entity*ent, Architecture*arc, const VType*ltype);