@@ -11,7 +11,7 @@ Author: Marek Trtik
1111
1212void goto_statisticst::extend (
1313 const goto_functionst &functions,
14- const symbol_tablet & table)
14+ const symbol_tablet &table)
1515{
1616 for (auto const &elem : functions.function_map )
1717 {
@@ -45,45 +45,35 @@ void goto_statisticst::extend(
4545 }
4646 for (const auto &name_symbol : table.symbols )
4747 {
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 )
4949 {
5050 if (name_symbol.second .is_auxiliary )
5151 ++num_auxiliary_variables;
5252 else
53- ++num_genuine_variables ;
53+ ++num_user_variables ;
5454 }
5555 }
5656}
5757
5858jsont to_json (const goto_statisticst &stats)
5959{
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-
7060 json_objectt json_stats;
7161 json_stats[" num_functions" ]=
72- json_numbert (localt ::to_string (stats.get_num_functions ()));
62+ json_numbert (std ::to_string (stats.get_num_functions ()));
7363 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 ()));
7767 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 ()));
7969 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 ()));
8171 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 ()));
8373 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 ()));
8575 json_stats[" num_loops" ]=
86- json_numbert (localt ::to_string (stats.get_num_loops ()));
76+ json_numbert (std ::to_string (stats.get_num_loops ()));
8777
8878 return json_stats;
8979}
0 commit comments