@@ -11,7 +11,7 @@ Author: Marek Trtik
11
11
12
12
void goto_statisticst::extend (
13
13
const goto_functionst &functions,
14
- const symbol_tablet & table)
14
+ const symbol_tablet &table)
15
15
{
16
16
for (auto const &elem : functions.function_map )
17
17
{
@@ -45,45 +45,35 @@ void goto_statisticst::extend(
45
45
}
46
46
for (const auto &name_symbol : table.symbols )
47
47
{
48
- if (name_symbol.second .is_lvalue and name_symbol.second .is_state_var )
48
+ if (name_symbol.second .is_lvalue && name_symbol.second .is_state_var )
49
49
{
50
50
if (name_symbol.second .is_auxiliary )
51
51
++num_auxiliary_variables;
52
52
else
53
- ++num_genuine_variables ;
53
+ ++num_user_variables ;
54
54
}
55
55
}
56
56
}
57
57
58
58
jsont to_json (const goto_statisticst &stats)
59
59
{
60
- struct localt
61
- {
62
- static std::string to_string (const std::size_t number)
63
- {
64
- std::stringstream sstr;
65
- sstr << number;
66
- return sstr.str ();
67
- }
68
- };
69
-
70
60
json_objectt json_stats;
71
61
json_stats[" num_functions" ]=
72
- json_numbert (localt ::to_string (stats.get_num_functions ()));
62
+ json_numbert (std ::to_string (stats.get_num_functions ()));
73
63
json_stats[" num_instructions" ]=
74
- json_numbert (localt ::to_string (stats.get_num_instructions ()));
75
- json_stats[" num_genuine_variables " ]=
76
- json_numbert (localt ::to_string (stats.get_num_genuine_variables ()));
64
+ json_numbert (std ::to_string (stats.get_num_instructions ()));
65
+ json_stats[" num_user_variables " ]=
66
+ json_numbert (std ::to_string (stats.get_num_user_variables ()));
77
67
json_stats[" num_auxiliary_variables" ]=
78
- json_numbert (localt ::to_string (stats.get_num_auxiliary_variables ()));
68
+ json_numbert (std ::to_string (stats.get_num_auxiliary_variables ()));
79
69
json_stats[" num_function_calls" ]=
80
- json_numbert (localt ::to_string (stats.get_num_function_calls ()));
70
+ json_numbert (std ::to_string (stats.get_num_function_calls ()));
81
71
json_stats[" num_unconditional_gotos" ]=
82
- json_numbert (localt ::to_string (stats.get_num_unconditional_gotos ()));
72
+ json_numbert (std ::to_string (stats.get_num_unconditional_gotos ()));
83
73
json_stats[" num_conditional_gotos" ]=
84
- json_numbert (localt ::to_string (stats.get_num_conditional_gotos ()));
74
+ json_numbert (std ::to_string (stats.get_num_conditional_gotos ()));
85
75
json_stats[" num_loops" ]=
86
- json_numbert (localt ::to_string (stats.get_num_loops ()));
76
+ json_numbert (std ::to_string (stats.get_num_loops ()));
87
77
88
78
return json_stats;
89
79
}
0 commit comments