Skip to content

Commit 341d403

Browse files
author
Peter Schrammel
committed
output total number of functions
1 parent 80c99c5 commit 341d403

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/goto-diff/goto_diff.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ class goto_difft : public messaget
2828
messaget(_message_handler),
2929
goto_model1(_goto_model1),
3030
goto_model2(_goto_model2),
31-
ui(ui_message_handlert::PLAIN)
31+
ui(ui_message_handlert::PLAIN),
32+
total_functions_count(0)
3233
{}
3334

3435
virtual bool operator()()=0;
@@ -42,6 +43,7 @@ class goto_difft : public messaget
4243
const goto_modelt &goto_model2;
4344
language_uit::uit ui;
4445

46+
unsigned total_functions_count;
4547
typedef std::set<irep_idt> irep_id_sett;
4648
irep_id_sett new_functions, modified_functions, deleted_functions;
4749

src/goto-diff/goto_diff_base.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Author: Peter Schrammel
66
77
\*******************************************************************/
88

9+
#include <util/i2string.h>
10+
911
#include "goto_diff.h"
1012

1113
/*******************************************************************\
@@ -26,6 +28,7 @@ std::ostream &goto_difft::output_functions(std::ostream &out) const
2628
{
2729
case ui_message_handlert::PLAIN:
2830
{
31+
out << "total number of functions: " << total_functions_count << "\n";
2932
out << "new functions: \n";
3033
for(irep_id_sett::const_iterator it = new_functions.begin();
3134
it != new_functions.end(); ++it)
@@ -63,6 +66,8 @@ std::ostream &goto_difft::output_functions(std::ostream &out) const
6366
case ui_message_handlert::JSON_UI:
6467
{
6568
json_objectt json_result;
69+
json_result["TotalNumberOfFunctions"] =
70+
json_stringt(i2string(total_functions_count));
6671
convert_function_group
6772
(json_result["NewFunctions"].make_array(), new_functions);
6873
convert_function_group(

src/goto-diff/syntactic_diff.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ bool syntactic_difft::operator()()
6868
if(!it->second.body_available())
6969
continue;
7070

71+
total_functions_count++;
72+
7173
goto_functionst::function_mapt::const_iterator f_it =
7274
goto_model1.goto_functions.function_map.find(it->first);
7375
if(f_it==goto_model1.goto_functions.function_map.end() ||

0 commit comments

Comments
 (0)