Clean up vhdl_comp_inst

This commit is contained in:
Nick Gasson 2008-06-10 14:00:15 +01:00
parent babe694366
commit 5a7cfd8c02
2 changed files with 10 additions and 1 deletions

View File

@ -255,6 +255,15 @@ vhdl_comp_inst::vhdl_comp_inst(const char *inst_name, const char *comp_name)
}
vhdl_comp_inst::~vhdl_comp_inst()
{
port_map_list_t::iterator it;
for (it = mapping_.begin(); it != mapping_.end(); ++it) {
delete (*it).expr;
}
mapping_.clear();
}
void vhdl_comp_inst::map_port(const char *name, vhdl_expr *expr)
{
port_map_t pmap = { name, expr };

View File

@ -368,7 +368,7 @@ typedef std::list<port_map_t> port_map_list_t;
class vhdl_comp_inst : public vhdl_conc_stmt {
public:
vhdl_comp_inst(const char *inst_name, const char *comp_name);
virtual ~vhdl_comp_inst() {}
~vhdl_comp_inst();
void emit(std::ofstream &of, int level) const;
void map_port(const char *name, vhdl_expr *expr);