summaryrefslogtreecommitdiff
path: root/frontends/ilang/parser.y
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-07-25 15:05:18 +0200
committerClifford Wolf <clifford@clifford.at>2014-07-25 17:56:19 +0200
commit2bec47a4045d23d46e7d300cbf80b2dce1a549a9 (patch)
tree991a75afe9b009486a57834fefee075ec695a28c /frontends/ilang/parser.y
parent5826670009e1018734de49aaf1554cb8a43d09d7 (diff)
Use only module->addCell() and module->remove() to create and delete cells
Diffstat (limited to 'frontends/ilang/parser.y')
-rw-r--r--frontends/ilang/parser.y5
1 files changed, 1 insertions, 4 deletions
diff --git a/frontends/ilang/parser.y b/frontends/ilang/parser.y
index 3fe5199f..82826a35 100644
--- a/frontends/ilang/parser.y
+++ b/frontends/ilang/parser.y
@@ -182,11 +182,8 @@ cell_stmt:
TOK_CELL TOK_ID TOK_ID EOL {
if (current_module->cells.count($3) != 0)
rtlil_frontend_ilang_yyerror(stringf("ilang error: redefinition of cell %s.", $3).c_str());
- current_cell = new RTLIL::Cell;
- current_cell->type = $2;
- current_cell->name = $3;
+ current_cell = current_module->addCell($3, $2);
current_cell->attributes = attrbuf;
- current_module->cells[$3] = current_cell;
attrbuf.clear();
free($2);
free($3);