Record typedef name in data_type_t struct.

This will be used to locate the scope where the type was declared.
This commit is contained in:
Martin Whitaker 2019-12-22 11:12:14 +00:00
parent 95147a2cc2
commit 732a763188
3 changed files with 7 additions and 7 deletions

View File

@ -215,9 +215,9 @@ netstruct_t* struct_type_t::elaborate_type_raw(Design*des, NetScope*scope) const
// There may be several names that are the same type:
// <data_type> name1, name2, ...;
// Process all the member, and give them a type.
for (list<decl_assignment_t*>::iterator name = curp->names->begin()
; name != curp->names->end() ; ++ name) {
decl_assignment_t*namep = *name;
for (list<decl_assignment_t*>::iterator cur_name = curp->names->begin()
; cur_name != curp->names->end() ; ++ cur_name) {
decl_assignment_t*namep = *cur_name;
netstruct_t::member_t memb;
memb.name = namep->name;

View File

@ -867,6 +867,7 @@ void pform_set_typedef(perm_string name, data_type_t*data_type, std::list<pform_
ivl_assert(*data_type, ref == 0);
ref = data_type;
ref->name = name;
if (enum_type_t*enum_type = dynamic_cast<enum_type_t*>(data_type))
pform_put_enum_type_in_scope(enum_type);

View File

@ -151,6 +151,8 @@ class data_type_t : public PNamedItem {
virtual SymbolType symbol_type() const;
perm_string name;
private:
// Elaborate the type to an ivl_type_s type.
virtual ivl_type_s* elaborate_type_raw(Design*des, NetScope*scope) const;
@ -299,14 +301,11 @@ struct string_type_t : public data_type_t {
struct class_type_t : public data_type_t {
inline explicit class_type_t(perm_string n)
: name(n), base_type(0), save_elaborated_type(0) { }
: base_type(0), save_elaborated_type(0) { name = n; }
void pform_dump(std::ostream&out, unsigned indent) const;
void pform_dump_init(std::ostream&out, unsigned indent) const;
// This is the name of the class type.
perm_string name;
// This is the named type that is supposed to be the base
// class that we are extending. This is nil if there is no
// hierarchy. If there are arguments to the base class, then