@@ -40,15 +40,12 @@ void cpp_typecheckt::typecheck_method_bodies()
40
40
continue ;
41
41
42
42
#ifdef DEBUG
43
- std::cout << " convert_method_body: " << method_symbol.name << std::endl ;
44
- std::cout << " is_not_nil: " << body.is_not_nil () << std::endl ;
45
- std::cout << " !is_zero: " << (!body.is_zero ()) << std::endl ;
43
+ std::cout << " convert_method_body: " << method_symbol.name << " \n " ;
44
+ std::cout << " is_not_nil: " << body.is_not_nil () << " \n " ;
45
+ std::cout << " !is_zero: " << (!body.is_zero ()) << " \n " ;
46
46
#endif
47
- if (body.is_not_nil () &&
48
- !body.is_zero ())
49
- {
47
+ if (body.is_not_nil () && !body.is_zero ())
50
48
convert_function (method_symbol);
51
- }
52
49
}
53
50
54
51
old_instantiation_stack.swap (instantiation_stack);
@@ -57,22 +54,16 @@ void cpp_typecheckt::typecheck_method_bodies()
57
54
void cpp_typecheckt::add_method_body (symbolt *_method_symbol)
58
55
{
59
56
#ifdef DEBUG
60
- std::cout << " add_method_body: " << _method_symbol->name << std::endl ;
57
+ std::cout << " add_method_body: " << _method_symbol->name << " \n " ;
61
58
#endif
62
-
63
- // We have to prevent the same method to be added multiple times
64
- // otherwise we get duplicated symbol prefixes
65
- if (methods_seen.find (_method_symbol->name ) != methods_seen.end ())
66
- {
59
+ // Converting a method body might add method bodies for methods that we have
60
+ // already analyzed. Adding the same method more than once causes duplicated
61
+ // symbol prefixes, therefore we have to keep track.
62
+ if (methods_seen.insert (_method_symbol->name ).second )
63
+ method_bodies.push_back (method_bodyt (
64
+ _method_symbol, template_map, instantiation_stack));
67
65
#ifdef DEBUG
68
- std::cout << " already exists" << std::endl;
66
+ else
67
+ std::cout << " already exists" << " \n " ;
69
68
#endif
70
- return ;
71
- }
72
- method_bodies.push_back (method_bodyt (
73
- _method_symbol, template_map, instantiation_stack));
74
-
75
- // Converting a method body might add method bodies for methods
76
- // that we have already analyzed. Hence, we have to keep track.
77
- methods_seen.insert (_method_symbol->name );
78
69
}
0 commit comments