vhdlpp: Added ReturnStmt::cast_to() method.
This commit is contained in:
parent
b8b2f53027
commit
839f9cd7ae
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
# include "sequential.h"
|
||||
# include "expression.h"
|
||||
# include <cassert>
|
||||
|
||||
template<typename T>
|
||||
inline static void visit_stmt_list(std::list<T*>& stmts, SeqStmtVisitor& func)
|
||||
|
|
@ -195,6 +196,12 @@ ReturnStmt::~ReturnStmt()
|
|||
delete val_;
|
||||
}
|
||||
|
||||
void ReturnStmt::cast_to(const VType*type)
|
||||
{
|
||||
assert(val_);
|
||||
val_ = new ExpCast(val_, type);
|
||||
}
|
||||
|
||||
LoopStatement::LoopStatement(perm_string name, list<SequentialStmt*>* stmts)
|
||||
: name_(name)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ class ReturnStmt : public SequentialStmt {
|
|||
void dump(ostream&out, int indent) const;
|
||||
|
||||
const Expression*peek_expr() const { return val_; };
|
||||
void cast_to(const VType*type);
|
||||
|
||||
private:
|
||||
Expression*val_;
|
||||
|
|
|
|||
Loading…
Reference in New Issue