vhdlpp: Added VType::get_generic_typename() method.

This commit is contained in:
Maciej Suminski 2015-01-22 11:32:28 +01:00
parent 9b3bd039bb
commit b8b2f53027
2 changed files with 12 additions and 0 deletions

View File

@ -19,6 +19,7 @@
# include "vtype.h"
# include "parse_types.h"
# include "compiler.h"
# include <map>
# include <typeinfo>
# include <cassert>
@ -35,6 +36,13 @@ void VType::show(ostream&out) const
write_to_stream(out);
}
perm_string VType::get_generic_typename() const
{
char buf[16] = {0,};
snprintf(buf, 16, "type_%p", this);
return lex_strings.make(buf);
}
VTypePrimitive::VTypePrimitive(VTypePrimitive::type_t tt, bool packed)
: type_(tt), packed_(packed)
{

View File

@ -88,6 +88,10 @@ class VType {
// Returns true if the type has an undefined dimension.
virtual bool is_unbounded() const { return false; }
// Returns a perm_string that can be used in automatically created
// typedefs (i.e. not ones defined by the user).
perm_string get_generic_typename() const;
private:
friend struct decl_t;
// This virtual method is called to emit the declaration. This