mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-22 05:47:31 +02:00
vhdlpp: Added VType::get_generic_typename() method.
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
# include "vtype.h"
|
# include "vtype.h"
|
||||||
# include "parse_types.h"
|
# include "parse_types.h"
|
||||||
|
# include "compiler.h"
|
||||||
# include <map>
|
# include <map>
|
||||||
# include <typeinfo>
|
# include <typeinfo>
|
||||||
# include <cassert>
|
# include <cassert>
|
||||||
@@ -35,6 +36,13 @@ void VType::show(ostream&out) const
|
|||||||
write_to_stream(out);
|
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)
|
VTypePrimitive::VTypePrimitive(VTypePrimitive::type_t tt, bool packed)
|
||||||
: type_(tt), packed_(packed)
|
: type_(tt), packed_(packed)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -88,6 +88,10 @@ class VType {
|
|||||||
// Returns true if the type has an undefined dimension.
|
// Returns true if the type has an undefined dimension.
|
||||||
virtual bool is_unbounded() const { return false; }
|
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:
|
private:
|
||||||
friend struct decl_t;
|
friend struct decl_t;
|
||||||
// This virtual method is called to emit the declaration. This
|
// This virtual method is called to emit the declaration. This
|
||||||
|
|||||||
Reference in New Issue
Block a user