vhdlpp: Corrected VTypeDef::emit_def() to allow typedefed names in function headers.

This commit is contained in:
Maciej Suminski 2015-01-23 14:14:34 +01:00
parent 2ecfed0baa
commit 870a826225
2 changed files with 4 additions and 2 deletions

View File

@ -49,7 +49,8 @@ int Package::emit_package(ostream&fd) const
for (map<perm_string,const VType*>::const_iterator cur = cur_types_.begin()
; cur != cur_types_.end() ; ++ cur) {
fd << "typedef ";
errors += cur->second->emit_def(fd, cur->first);
errors += cur->second->emit_def(fd,
dynamic_cast<const VTypeDef*>(cur->second) ? empty_perm_string : cur->first);
fd << " ;" << endl;
}

View File

@ -209,10 +209,11 @@ int VTypeRecord::emit_def(ostream&out, perm_string name) const
* type. (We are defining a variable here, not the type itself.) The
* emit_typedef() method was presumably called to define type already.
*/
int VTypeDef::emit_def(ostream&out, perm_string) const
int VTypeDef::emit_def(ostream&out, perm_string name) const
{
int errors = 0;
emit_name(out, name_);
emit_name(out, name);
return errors;
}