diff --git a/vhdlpp/vtype.h b/vhdlpp/vtype.h index 3b9356e60..a4bdf9baf 100644 --- a/vhdlpp/vtype.h +++ b/vhdlpp/vtype.h @@ -109,8 +109,6 @@ class VType { // to evaluate. virtual int get_width(ScopeBase*) const { return -1; } - private: - friend struct decl_t; // This virtual method is called to emit the declaration. This // is used by the decl_t object to emit variable/wire/port declarations. virtual int emit_decl(std::ostream&out, perm_string name, bool reg_flag) const; @@ -411,6 +409,7 @@ class VTypeDef : public VType { int emit_typedef(std::ostream&out, typedef_context_t&ctx) const; int emit_def(std::ostream&out, perm_string name) const; + int emit_decl(std::ostream&out, perm_string name, bool reg_flag) const; bool can_be_packed() const { return type_->can_be_packed(); } @@ -419,9 +418,6 @@ class VTypeDef : public VType { protected: perm_string name_; const VType*type_; - - private: - int emit_decl(std::ostream&out, perm_string name, bool reg_flag) const; }; class VSubTypeDef : public VTypeDef { diff --git a/vhdlpp/vtype_emit.cc b/vhdlpp/vtype_emit.cc index 53fb612bb..48ffd50d7 100644 --- a/vhdlpp/vtype_emit.cc +++ b/vhdlpp/vtype_emit.cc @@ -235,28 +235,15 @@ int VTypeRecord::emit_def(ostream&out, perm_string name) const */ int VTypeDef::emit_def(ostream&out, perm_string name) const { - int errors = 0; emit_name(out, name_); emit_name(out, name); - return errors; + + return 0; } int VTypeDef::emit_decl(ostream&out, perm_string name, bool reg_flag) const { - int errors = 0; - - if(!reg_flag) - out << "wire "; - - if(dynamic_cast(type_)) { - errors += type_->emit_def(out, name); - } else { - assert(name_ != empty_perm_string); - cout << "\\" << name_; - emit_name(out, name); - } - - return errors; + return type_->emit_decl(out, name, reg_flag); } int VTypeDef::emit_typedef(ostream&out, typedef_context_t&ctx) const