@@ -37,9 +37,9 @@ void cpp_typecheckt::typecheck_method_bodies()
37
37
continue ;
38
38
39
39
#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 ' ;
43
43
#endif
44
44
if (body.is_not_nil () && !body.is_zero ())
45
45
convert_function (method_symbol);
@@ -51,22 +51,18 @@ void cpp_typecheckt::typecheck_method_bodies()
51
51
void cpp_typecheckt::add_method_body (symbolt *_method_symbol)
52
52
{
53
53
#ifdef DEBUG
54
- std::cout << " add_method_body: " << _method_symbol->name << std::endl ;
54
+ std::cout << " add_method_body: " << _method_symbol->name << ' \n ' ;
55
55
#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 )
60
60
{
61
+ method_bodies.push_back (
62
+ method_bodyt (_method_symbol, template_map, instantiation_stack));
63
+ }
61
64
#ifdef DEBUG
62
- std::cout << " already exists" << std::endl;
65
+ else
66
+ std::cout << " already exists\n " ;
63
67
#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 );
72
68
}
0 commit comments