Skip to content

Commit a291f52

Browse files
committed
Value set debug output: make it build, use DEBUG macro
We had a mix of #if 0 and #ifdef DEBUG. Always use the latter and make the code compile again.
1 parent 3776f10 commit a291f52

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/pointer-analysis/value_set.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,10 @@ void value_sett::get_value_set_rec(
453453
const typet &original_type,
454454
const namespacet &ns) const
455455
{
456-
#if 0
456+
#ifdef DEBUG
457457
std::cout << "GET_VALUE_SET_REC EXPR: " << format(expr) << "\n";
458458
std::cout << "GET_VALUE_SET_REC SUFFIX: " << suffix << '\n';
459-
#endif
459+
#endif
460460

461461
const typet &expr_type=ns.follow(expr.type());
462462

@@ -1013,10 +1013,10 @@ void value_sett::get_reference_set_rec(
10131013
object_mapt &dest,
10141014
const namespacet &ns) const
10151015
{
1016-
#if 0
1016+
#ifdef DEBUG
10171017
std::cout << "GET_REFERENCE_SET_REC EXPR: " << format(expr)
10181018
<< '\n';
1019-
#endif
1019+
#endif
10201020

10211021
if(expr.id()==ID_symbol ||
10221022
expr.id()==ID_dynamic_object ||
@@ -1037,10 +1037,12 @@ void value_sett::get_reference_set_rec(
10371037

10381038
get_value_set_rec(pointer, dest, "", pointer.type(), ns);
10391039

1040-
#if 0
1041-
for(expr_sett::const_iterator it=value_set.begin();
1042-
it!=value_set.end(); it++)
1043-
std::cout << "VALUE_SET: " << format(*it) << '\n';
1040+
#ifdef DEBUG
1041+
for(const auto &map_entry : dest.read())
1042+
{
1043+
std::cout << "VALUE_SET: " << format(object_numbering[map_entry.first])
1044+
<< '\n';
1045+
}
10441046
#endif
10451047

10461048
return;
@@ -1169,13 +1171,13 @@ void value_sett::assign(
11691171
bool is_simplified,
11701172
bool add_to_sets)
11711173
{
1172-
#if 0
1174+
#ifdef DEBUG
11731175
std::cout << "ASSIGN LHS: " << format(lhs) << " : "
11741176
<< format(lhs.type()) << '\n';
11751177
std::cout << "ASSIGN RHS: " << format(rhs) << " : "
11761178
<< format(rhs.type()) << '\n';
11771179
std::cout << "--------------------------------------------\n";
1178-
output(ns, std::cout);
1180+
output(std::cout);
11791181
#endif
11801182

11811183
const typet &type=ns.follow(lhs.type());
@@ -1304,7 +1306,7 @@ void value_sett::assign_rec(
13041306
const namespacet &ns,
13051307
bool add_to_sets)
13061308
{
1307-
#if 0
1309+
#ifdef DEBUG
13081310
std::cout << "ASSIGN_REC LHS: " << format(lhs) << '\n';
13091311
std::cout << "ASSIGN_REC LHS ID: " << lhs.id() << '\n';
13101312
std::cout << "ASSIGN_REC SUFFIX: " << suffix << '\n';
@@ -1315,7 +1317,7 @@ void value_sett::assign_rec(
13151317
std::cout << "ASSIGN_REC RHS: " <<
13161318
format(object_numbering[it->first]) << '\n';
13171319
std::cout << '\n';
1318-
#endif
1320+
#endif
13191321

13201322
if(lhs.id()==ID_symbol)
13211323
{

0 commit comments

Comments
 (0)