@@ -618,63 +618,12 @@ void goto_symex_statet::rename_address(
618
618
}
619
619
}
620
620
621
- static bool requires_renaming (const typet &type, const namespacet &ns)
622
- {
623
- if (type.id () == ID_array)
624
- {
625
- const auto &array_type = to_array_type (type);
626
- return requires_renaming (array_type.subtype (), ns) ||
627
- !array_type.size ().is_constant ();
628
- }
629
- else if (
630
- type.id () == ID_struct || type.id () == ID_union || type.id () == ID_class)
631
- {
632
- const struct_union_typet &s_u_type = to_struct_union_type (type);
633
- const struct_union_typet::componentst &components = s_u_type.components ();
634
-
635
- for (auto &component : components)
636
- {
637
- // be careful, or it might get cyclic
638
- if (component.type ().id () != ID_pointer)
639
- return requires_renaming (component.type (), ns);
640
- }
641
-
642
- return false ;
643
- }
644
- else if (type.id () == ID_pointer)
645
- {
646
- return requires_renaming (to_pointer_type (type).subtype (), ns);
647
- }
648
- else if (type.id () == ID_symbol_type)
649
- {
650
- const symbolt &symbol = ns.lookup (to_symbol_type (type));
651
- return requires_renaming (symbol.type , ns);
652
- }
653
- else if (type.id () == ID_union_tag)
654
- {
655
- const symbolt &symbol = ns.lookup (to_union_tag_type (type));
656
- return requires_renaming (symbol.type , ns);
657
- }
658
- else if (type.id () == ID_struct_tag)
659
- {
660
- const symbolt &symbol = ns.lookup (to_struct_tag_type (type));
661
- return requires_renaming (symbol.type , ns);
662
- }
663
-
664
- return false ;
665
- }
666
-
667
621
void goto_symex_statet::rename (
668
622
typet &type,
669
623
const irep_idt &l1_identifier,
670
624
const namespacet &ns,
671
625
levelt level)
672
626
{
673
- // check whether there are symbol expressions in the type; if not, there
674
- // is no need to expand the struct/union tags in the type
675
- if (!requires_renaming (type, ns))
676
- return ; // no action
677
-
678
627
// rename all the symbols with their last known value
679
628
// to the given level
680
629
0 commit comments