Skip to content

Commit 1e689b0

Browse files
zhixing-xutautschnig
authored andcommitted
Delete debug outputs and coding style update
1 parent 0d61327 commit 1e689b0

File tree

5 files changed

+5
-29
lines changed

5 files changed

+5
-29
lines changed

regression/goto-analyzer/dependence-graph13/main.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#include <assert.h>
2-
31
void bar(int a, int b)
42
{
53
int result = b;
@@ -12,4 +10,3 @@ void main()
1210
int c = 3;
1311
bar(a, b + c);
1412
}
15-

regression/goto-analyzer/dependence-graph13/test.desc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ main.c
44
activate-multi-line-match
55
^EXIT=0$
66
^SIGNAL=0$
7-
// Assignment has a data dependency on the assignment of b
87
\/\/ ([0-9]+).*\n.*b = 2;(.*\n)*Data dependencies: (([0-9]+,\1)|(\1,[0-9]+))\n(.*\n){2,3}.*result = b
9-
// Assignment has a data dependency on the assignment of c
108
\/\/ ([0-9]+).*\n.*c = 3;(.*\n)*Data dependencies: (([0-9]+,\1)|(\1,[0-9]+))\n(.*\n){2,3}.*result = b
119
--
1210
^warning: ignoring

src/analyses/dependence_graph.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Date: August 2013
2020
#include <util/json_irep.h>
2121

2222
#include "goto_rw.h"
23-
#include <iostream>
2423

2524
bool dep_graph_domaint::merge(
2625
const dep_graph_domaint &src,
@@ -166,14 +165,13 @@ void dep_graph_domaint::data_dependencies(
166165
dep_graph.reaching_definitions().get_value_sets();
167166
rw_range_set_value_sett rw_set(ns, value_sets);
168167
goto_rw(function_to, to, rw_set);
169-
std::cerr << "\ndata_deps from " << from->location_number << " to " << to->location_number << "\n";
170168

171169
forall_rw_range_set_r_objects(it, rw_set)
172170
{
173-
std::cerr << "Checking for symbol : " << it->first << "\n";
174171
const range_domaint &r_ranges=rw_set.get_ranges(it);
175172
const rd_range_domaint::ranges_at_loct &w_ranges=
176173
dep_graph.reaching_definitions()[to].get(it->first);
174+
177175
for(const auto &w_range : w_ranges)
178176
{
179177
bool found=false;
@@ -185,7 +183,6 @@ void dep_graph_domaint::data_dependencies(
185183
{
186184
// found a def-use pair
187185
data_deps.insert(w_range.first);
188-
std::cerr << " insert data_deps " << w_range.first->location_number << "\n";
189186
found=true;
190187
}
191188
}

src/analyses/goto_rw.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ class rw_range_sett
122122
virtual ~rw_range_sett();
123123

124124
explicit rw_range_sett(const namespacet &_ns):
125-
ns(_ns)
125+
ns(_ns), is_get_expr_r_set(false)
126126
{
127-
is_get_expr_r_set = false;
128127
}
129128

130129
const objectst &get_r_set() const

src/analyses/reaching_definitions.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ Date: February 2013
2020
#include <util/pointer_offset_size.h>
2121
#include <util/prefix.h>
2222
#include <util/make_unique.h>
23-
#include <util/find_symbols.h>
2423

2524
#include <pointer-analysis/value_set_analysis_fi.h>
2625

2726
#include "is_threaded.h"
2827
#include "dirty.h"
29-
#include <iostream>
3028

3129
reaching_definitions_analysist::reaching_definitions_analysist(
3230
const namespacet &_ns):
@@ -186,7 +184,6 @@ void rd_range_domaint::transform_function_call(
186184
reaching_definitions_analysist &rd)
187185
{
188186
const code_function_callt &code=to_code_function_call(from->code);
189-
std::cerr << "\ntransform function call from " << from->location_number << " to " << to->location_number << "\n";
190187

191188
// only if there is an actual call, i.e., we have a body
192189
if(function_from != function_to)
@@ -218,12 +215,7 @@ void rd_range_domaint::transform_function_call(
218215
const code_typet &code_type=
219216
to_code_type(ns.lookup(fn_symbol_expr.get_identifier()).type);
220217

221-
std::cerr << "function name :" << fn_symbol_expr.get_identifier() << "\n";
222-
223218
rw_range_set_value_sett rw_set(ns, rd.get_value_sets());
224-
//goto_rw(from, rw_set);
225-
rw_set.output(std::cout);
226-
//const rw_range_sett::objectst r_objects = rw_set.get_r_set();
227219

228220
PRECONDITION(code_type.parameters().size() == code.arguments().size());
229221
auto param = code_type.parameters().begin();
@@ -237,20 +229,15 @@ void rd_range_domaint::transform_function_call(
237229
if(identifier.empty())
238230
continue;
239231

240-
std::cout << " param name: " << identifier << "\n";
241232
// get read set of the argument
242233
rw_set.set_expr_r_set();
243234
rw_set.get_objects_rec(from, rw_range_sett::get_modet::READ, *arg);
244-
std::cout << " argument set: \n";
245-
for(rw_range_sett::objectst::const_iterator
246-
it=(rw_set).get_expr_r_set().begin();
247-
it!=(rw_set).get_expr_r_set().end(); ++it)
235+
for(const auto &r_set_pair : (rw_set).get_expr_r_set())
248236
{
249-
std::cout << it->first << ":";
250-
const rd_range_domaint::ranges_at_loct &w_ranges = rd[from].get(it->first);
237+
const rd_range_domaint::ranges_at_loct &w_ranges
238+
= rd[from].get(r_set_pair.first);
251239
for(const auto &w_range : w_ranges)
252240
{
253-
std::cerr << " further dep on: " << w_range.first->location_number << "\n";
254241
for(const auto &wr : w_range.second)
255242
gen(w_range.first, identifier, wr.first, wr.second);
256243
}
@@ -344,10 +331,8 @@ void rd_range_domaint::transform_assign(
344331
locationt to,
345332
reaching_definitions_analysist &rd)
346333
{
347-
std::cerr << "\ntransform assign from " << from->location_number << " to " << to->location_number << "\n";
348334
rw_range_set_value_sett rw_set(ns, rd.get_value_sets());
349335
goto_rw(function_to, to, rw_set);
350-
rw_set.output(std::cerr);
351336
const bool is_must_alias=rw_set.get_w_set().size()==1;
352337

353338
forall_rw_range_set_w_objects(it, rw_set)

0 commit comments

Comments
 (0)