Skip to content

Remove DEBUG ifdefs which broke the debug build #647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,8 @@ script:
COMMAND="env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test" &&
eval ${PRE_COMMAND} ${COMMAND} &&
COMMAND="make -C src CXX=$COMPILER CXXFLAGS=$FLAGS -j2 cegis.dir clobber.dir memory-models.dir musketeer.dir" &&
eval ${PRE_COMMAND} ${COMMAND} &&
COMMAND="make -C src clean" &&
eval ${PRE_COMMAND} ${COMMAND} &&
COMMAND="make -C src CXX=$COMPILER CXXFLAGS=\"-Wall -O0 -ggdb3 -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare -DDEBUG\" -j2" &&
eval ${PRE_COMMAND} ${COMMAND}
9 changes: 8 additions & 1 deletion src/analyses/cfg_dominators.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,13 @@ void dominators_pretty_print_node(const T &node, std::ostream &out)
out << node;
}

inline void dominators_pretty_print_node(
const goto_programt::targett& target,
std::ostream& out)
{
out << target->code.pretty();
}

/*******************************************************************\

Function: cfg_dominators_templatet::output
Expand All @@ -241,7 +248,7 @@ void cfg_dominators_templatet<P, T, post_dom>::output(std::ostream &out) const
{
for(const auto &node : cfg.entry_map)
{
T n=node.first;
auto n=node.first;

dominators_pretty_print_node(n, out);
if(post_dom)
Expand Down
2 changes: 0 additions & 2 deletions src/analyses/constant_propagator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ Author: Peter Schrammel

\*******************************************************************/

// #define DEBUG

#ifdef DEBUG
#include <iostream>
#endif
Expand Down
2 changes: 0 additions & 2 deletions src/analyses/natural_loops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Author: Georg Weissenbacher, [email protected]

#include "natural_loops.h"

// #define DEBUG

/*******************************************************************\

Function: show_natural_loops
Expand Down
2 changes: 0 additions & 2 deletions src/analyses/natural_loops.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ Function: natural_loops_templatet::compute

\*******************************************************************/

// #define DEBUG

#ifdef DEBUG
#include <iostream>
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/cbmc/bmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ void bmct::setup_unwind()

for(auto &val : unwindset_loops)
{
unsigned thread_nr;
unsigned thread_nr=0;
bool thread_nr_set=false;

if(!val.empty() &&
Expand Down
24 changes: 10 additions & 14 deletions src/cpp/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ Author: Daniel Kroening, [email protected]
#include "cpp_member_spec.h"
#include "cpp_enum_type.h"

// #define DEBUG

#ifdef DEBUG
#include <iostream>

Expand Down Expand Up @@ -642,7 +640,7 @@ bool Parser::rDefinition(cpp_itemt &item)
#ifdef DEBUG
indenter _i;
std::cout << std::string(__indent, ' ') << "Parser::rDefinition 1 " << t
<< "\n";
<< '\n';
#endif

if(t==';')
Expand Down Expand Up @@ -1238,11 +1236,11 @@ bool Parser::rTemplateDecl(cpp_declarationt &decl)
{
case tdk_decl:
#ifdef DEBUG
std::cout << std::string(__indent, ' ') << "BODY: " << body << std::endl;
std::cout << std::string(__indent, ' ') << "BODY: "
<< body.pretty() << '\n';
std::cout << std::string(__indent, ' ') << "TEMPLATE_TYPE: "
<< template_type << std::endl;
<< template_type.pretty() << '\n';
#endif

body.add(ID_template_type).swap(template_type);
body.set(ID_is_template, true);
decl.swap(body);
Expand Down Expand Up @@ -1912,9 +1910,8 @@ bool Parser::rIntegralDeclaration(
#ifdef DEBUG
std::cout << std::string(__indent, ' ')
<< "Parser::rIntegralDeclaration 8 "
<< declaration << "\n";
<< declaration.pretty() << '\n';
#endif

lex.get_token(tk);
return true;
}
Expand Down Expand Up @@ -5118,10 +5115,9 @@ bool Parser::rClassBody(exprt &body)
// body=Ptree::List(ob, nil, new Leaf(tk));
return true; // error recovery
}

#ifdef DEBUG
std::cout << std::string(__indent, ' ') << "Parser::rClassBody " << member
<< std::endl;
std::cout << std::string(__indent, ' ') << "Parser::rClassBody "
<< member.pretty() << '\n';
#endif

members.move_to_operands(
Expand Down Expand Up @@ -7583,7 +7579,7 @@ bool Parser::rPrimaryExpr(exprt &exp)
#ifdef DEBUG
indenter _i;
std::cout << std::string(__indent, ' ') << "Parser::rPrimaryExpr 0 "
<< lex.LookAhead(0) << " " << lex.current_token().text <<"\n";
<< lex.LookAhead(0) << ' ' << lex.current_token().text << '\n';
#endif

switch(lex.LookAhead(0))
Expand Down Expand Up @@ -9245,8 +9241,8 @@ bool Parser::rExprStatement(codet &statement)
if(rDeclarationStatement(statement))
{
#ifdef DEBUG
std::cout << std::string(__indent, ' ') << "rDe: " << statement
<< std::endl;
std::cout << std::string(__indent, ' ') << "rDe "
<< statement.pretty() << '\n';
#endif
return true;
}
Expand Down
2 changes: 0 additions & 2 deletions src/goto-instrument/accelerate/accelerate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ Author: Matt Lewis
#include "overflow_instrumenter.h"
#include "util.h"

#define DEBUG

goto_programt::targett acceleratet::find_back_jump(
goto_programt::targett loop_header)
{
Expand Down
2 changes: 0 additions & 2 deletions src/goto-instrument/accelerate/acceleration_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ Author: Matt Lewis
#include "cone_of_influence.h"
#include "overflow_instrumenter.h"

#define DEBUG

void acceleration_utilst::gather_rvalues(
const exprt &expr,
expr_sett &rvalues)
Expand Down
2 changes: 0 additions & 2 deletions src/goto-instrument/accelerate/all_paths_enumerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Author: Matt Lewis

#include "all_paths_enumerator.h"

// #define DEBUG

bool all_paths_enumeratort::next(patht &path)
{
if(last_path.empty())
Expand Down
2 changes: 0 additions & 2 deletions src/goto-instrument/accelerate/cone_of_influence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ Author: Matt Lewis

#include "cone_of_influence.h"

// #define DEBUG

void cone_of_influencet::cone_of_influence(
const expr_sett &targets,
expr_sett &cone)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ Author: Matt Lewis
#include "cone_of_influence.h"
#include "overflow_instrumenter.h"

#define DEBUG


bool disjunctive_polynomial_accelerationt::accelerate(
path_acceleratort &accelerator)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Author: Matt Lewis

#include "enumerating_loop_acceleration.h"

// #define DEBUG

bool enumerating_loop_accelerationt::accelerate(
path_acceleratort &accelerator)
{
Expand Down
2 changes: 0 additions & 2 deletions src/goto-instrument/accelerate/overflow_instrumenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Author: Matt Lewis
#include "overflow_instrumenter.h"
#include "util.h"

// #define DEBUG

/*
* This code is copied wholesale from analyses/goto_check.cpp.
*/
Expand Down
3 changes: 0 additions & 3 deletions src/goto-instrument/accelerate/polynomial_accelerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ Author: Matt Lewis
#include "cone_of_influence.h"
#include "overflow_instrumenter.h"

#define DEBUG


bool polynomial_acceleratort::accelerate(
patht &loop,
path_acceleratort &accelerator)
Expand Down
2 changes: 0 additions & 2 deletions src/goto-instrument/accelerate/sat_path_enumerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ Author: Matt Lewis
#include "util.h"
#include "overflow_instrumenter.h"

#define DEBUG

bool sat_path_enumeratort::next(patht &path)
{
scratch_programt program(symbol_table);
Expand Down
10 changes: 4 additions & 6 deletions src/goto-instrument/accelerate/scratch_program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Author: Matt Lewis

#include "scratch_program.h"

// #define DEBUG

#ifdef DEBUG
#include <iostream>
#endif
Expand All @@ -31,8 +29,8 @@ bool scratch_programt::check_sat(bool do_slice)
update();

#ifdef DEBUG
std::cout << "Checking following program for satness:" << endl;
output(ns, "scratch", cout);
std::cout << "Checking following program for satness:\n";
output(ns, "scratch", std::cout);
#endif

symex.constant_propagation=constant_propagation;
Expand All @@ -49,15 +47,15 @@ bool scratch_programt::check_sat(bool do_slice)
{
// Symex sliced away all our assertions.
#ifdef DEBUG
std::cout << "Trivially unsat" << std::endl;
std::cout << "Trivially unsat\n";
#endif
return false;
}

equation.convert(*checker);

#ifdef DEBUG
cout << "Finished symex, invoking decision procedure." << endl;
std::cout << "Finished symex, invoking decision procedure.\n";
#endif

return (checker->dec_solve()==decision_proceduret::D_SATISFIABLE);
Expand Down
14 changes: 7 additions & 7 deletions src/goto-instrument/accelerate/trace_automaton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ Author: Matt Lewis
#include "trace_automaton.h"
#include "path.h"

// #define DEBUG

void trace_automatont::build()
{
#ifdef DEBUG
Expand Down Expand Up @@ -76,8 +74,10 @@ void trace_automatont::add_path(patht &path)
for(const auto &step : path)
{
goto_programt::targett l=step.loc;

#ifdef DEBUG
std::cout << ", " << l->location_number << ":" << l->location;
std::cout << ", " << l->location_number << ':'
<< l->source_location.as_string();
#endif

if(in_alphabet(l))
Expand Down Expand Up @@ -112,7 +112,7 @@ void trace_automatont::determinise()
std::cout << "Determinising automaton with " << nta.num_states
<< " states and " << nta.accept_states.size()
<< " accept states and " << nta.count_transitions()
<< " transitions" << endl;
<< " transitions\n";
#endif

dstates.clear();
Expand All @@ -124,7 +124,7 @@ void trace_automatont::determinise()
epsilon_closure(init_states);

#ifdef DEBUG
std::cout << "There are " << init_states.size() << " init states" << endl;
std::cout << "There are " << init_states.size() << " init states\n";
#endif

dta.init_state=add_dstate(init_states);
Expand Down Expand Up @@ -387,7 +387,7 @@ void automatont::reverse(goto_programt::targett epsilon)

std::cout << "Reversing automaton, old init=" << init_state
<< ", new init=" << new_init << ", old accept="
<< *(accept_states.begin()) << "/" << accept_states.size()
<< *(accept_states.begin()) << '/' << accept_states.size()
<< " new accept=" << init_state << std::endl;

accept_states.clear();
Expand Down Expand Up @@ -471,7 +471,7 @@ void automatont::output(std::ostream &str)
str << "Accept states: ";

for(const auto &state : accept_states)
str << state << " ";
str << state << ' ';

str << std::endl;

Expand Down
2 changes: 0 additions & 2 deletions src/goto-programs/goto_inline_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ Author: Daniel Kroening, [email protected]

\*******************************************************************/

// #define DEBUG

#ifdef DEBUG
#include <iostream>
#endif
Expand Down
9 changes: 4 additions & 5 deletions src/java_bytecode/java_local_variable_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static void populate_predecessor_map(
// handling is presently vague (any subroutine is assumed to
// be able to return to any callsite)
msg.warning() << "Local variable table: ignoring flow from "
<< "out of range for " << it->var.name << " "
<< "out of range for " << it->var.name << ' '
<< pred << " -> " << amapit->first
<< messaget::eom;
continue;
Expand All @@ -375,7 +375,7 @@ static void populate_predecessor_map(
// assumed to be able to return to any callsite)
msg.warning() << "Local variable table: ignoring flow from "
<< "clashing variable for "
<< it->var.name << " " << pred << " -> "
<< it->var.name << ' ' << pred << " -> "
<< amapit->first << messaget::eom;
continue;
}
Expand Down Expand Up @@ -549,9 +549,8 @@ static void merge_variable_table_entries(
#ifdef DEBUG
debug_out << "Merged " << merge_vars.size() << " variables named "
<< merge_into.var.name << "; new live range "
<< merge_into.var.start_pc << "-"
<< merge_into.var.start_pc + merge_into.var.length
<< messaget::eom;
<< merge_into.var.start_pc << '-'
<< merge_into.var.start_pc + merge_into.var.length << '\n';
#endif

// Nuke the now-subsumed var-table entries:
Expand Down
10 changes: 0 additions & 10 deletions src/linking/linking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,11 +936,6 @@ bool linkingt::adjust_object_type_rec(
else if(t1.id()!=t2.id())
{
// type classes do not match and can't be fixed
#ifdef DEBUG
str << "LINKING: cannot join " << t1.id() << " vs. " << t2.id();
debug_msg();
#endif

return true;
}

Expand Down Expand Up @@ -1041,11 +1036,6 @@ bool linkingt::adjust_object_type(
const symbolt &new_symbol,
bool &set_to_new)
{
#ifdef DEBUG
str << "LINKING: trying to adjust types of " << old_symbol.name;
debug_msg();
#endif

const typet &old_type=follow_tags_symbols(ns, old_symbol.type);
const typet &new_type=follow_tags_symbols(ns, new_symbol.type);

Expand Down
2 changes: 0 additions & 2 deletions src/path-symex/path_symex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Author: Daniel Kroening, [email protected]
#include "path_symex.h"
#include "path_symex_class.h"

// #define DEBUG

#ifdef DEBUG
#include <iostream>
#endif
Expand Down
Loading