@@ -37,9 +37,9 @@ void cpp_typecheckt::typecheck_method_bodies()
3737 continue ;
3838
3939#ifdef DEBUG
40- std::cout << " convert_method_body: " << method_symbol.name << std::endl ;
41- std::cout << " is_not_nil: " << body.is_not_nil () << std::endl ;
42- std::cout << " !is_zero: " << (!body.is_zero ()) << std::endl ;
40+ std::cout << " convert_method_body: " << method_symbol.name << ' \n ' ;
41+ std::cout << " is_not_nil: " << body.is_not_nil () << ' \n ' ;
42+ std::cout << " !is_zero: " << (!body.is_zero ()) << ' \n ' ;
4343#endif
4444 if (body.is_not_nil () && !body.is_zero ())
4545 convert_function (method_symbol);
@@ -51,22 +51,18 @@ void cpp_typecheckt::typecheck_method_bodies()
5151void cpp_typecheckt::add_method_body (symbolt *_method_symbol)
5252{
5353#ifdef DEBUG
54- std::cout << " add_method_body: " << _method_symbol->name << std::endl ;
54+ std::cout << " add_method_body: " << _method_symbol->name << ' \n ' ;
5555#endif
56-
57- // We have to prevent the same method to be added multiple times
58- // otherwise we get duplicated symbol prefixes
59- if (methods_seen.find (_method_symbol->name ) != methods_seen. end () )
56+ // Converting a method body might add method bodies for methods that we have
57+ // already analyzed. Adding the same method more than once causes duplicated
58+ // symbol prefixes, therefore we have to keep track.
59+ if (methods_seen.insert (_method_symbol->name ). second )
6060 {
61+ method_bodies.push_back (
62+ method_bodyt (_method_symbol, template_map, instantiation_stack));
63+ }
6164#ifdef DEBUG
62- std::cout << " already exists" << std::endl;
65+ else
66+ std::cout << " already exists\n " ;
6367#endif
64- return ;
65- }
66- method_bodies.push_back (
67- method_bodyt (_method_symbol, template_map, instantiation_stack));
68-
69- // Converting a method body might add method bodies for methods
70- // that we have already analyzed. Hence, we have to keep track.
71- methods_seen.insert (_method_symbol->name );
7268}
0 commit comments