Skip to content

Commit 8fa8e5b

Browse files
authored
Merge pull request #1214 from diffblue/smv-submodule-tc
SMV: submodules are now taken from module items
2 parents 5bc20fd + 81ee95d commit 8fa8e5b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/smvlang/smv_typecheck.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,21 +192,22 @@ Function: smv_typecheckt::flatten_hierarchy
192192

193193
void smv_typecheckt::flatten_hierarchy(smv_parse_treet::modulet &smv_module)
194194
{
195-
for(auto &var_it : smv_module.vars)
195+
for(auto &item : smv_module.items)
196196
{
197-
smv_parse_treet::mc_vart &var = var_it.second;
198-
199-
if(var.type.id()=="submodule")
197+
if(item.is_var() && item.expr.type().id() == "submodule")
200198
{
201-
exprt &inst=static_cast<exprt &>(static_cast<irept &>(var.type));
199+
exprt &inst =
200+
static_cast<exprt &>(static_cast<irept &>(item.expr.type()));
202201

203202
for(auto &op : inst.operands())
204203
convert(op, NORMAL);
205204

205+
auto instance_base_name = to_symbol_expr(item.expr).get_identifier();
206+
206207
instantiate(
207208
smv_module,
208209
inst.get(ID_identifier),
209-
var_it.first,
210+
instance_base_name,
210211
inst.operands(),
211212
inst.find_source_location());
212213
}

0 commit comments

Comments
 (0)