Skip to content

new help formatter and console API #7141

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 1 commit into from
Oct 24, 2022
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
2 changes: 0 additions & 2 deletions src/cprover/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ SRC = address_taken.cpp \
axioms.cpp \
bv_pointers_wide.cpp \
c_safety_checks.cpp \
console.cpp \
cprover_main.cpp \
cprover_parse_options.cpp \
counterexample_found.cpp \
Expand All @@ -13,7 +12,6 @@ SRC = address_taken.cpp \
format_hooks.cpp \
free_symbols.cpp \
generalization.cpp \
help_formatter.cpp \
inductiveness.cpp \
instrument_contracts.cpp \
instrument_given_invariants.cpp \
Expand Down
2 changes: 1 addition & 1 deletion src/cprover/cprover_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Author: Daniel Kroening, [email protected]
#include <util/config.h>
#include <util/cout_message.h>
#include <util/exit_codes.h>
#include <util/help_formatter.h>
#include <util/options.h>
#include <util/signal_catcher.h>
#include <util/ui_message.h>
Expand All @@ -35,7 +36,6 @@ Author: Daniel Kroening, [email protected]

#include "c_safety_checks.h"
#include "format_hooks.h"
#include "help_formatter.h"
#include "instrument_contracts.h"
#include "instrument_given_invariants.h"
#include "state_encoding.h"
Expand Down
2 changes: 1 addition & 1 deletion src/cprover/generalization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Author: Daniel Kroening, [email protected]

#include "generalization.h"

#include <util/console.h>
#include <util/format_expr.h>

#include "console.h"
#include "solver.h"

#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion src/cprover/inductiveness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Author: Daniel Kroening, [email protected]
#include "inductiveness.h"

#include <util/arith_tools.h>
#include <util/console.h>
#include <util/cout_message.h>
#include <util/format_expr.h>
#include <util/simplify_expr.h>
Expand All @@ -20,7 +21,6 @@ Author: Daniel Kroening, [email protected]

#include "axioms.h"
#include "bv_pointers_wide.h"
#include "console.h"
#include "counterexample_found.h"
#include "propagate.h"
#include "solver.h"
Expand Down
2 changes: 1 addition & 1 deletion src/cprover/propagate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Author: Daniel Kroening, [email protected]

#include "propagate.h"

#include <util/console.h>
#include <util/format_expr.h>
#include <util/simplify_expr.h>

#include "console.h"
#include "simplify_state_expr.h"
#include "state.h"

Expand Down
3 changes: 1 addition & 2 deletions src/cprover/report_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ Author: Daniel Kroening, [email protected]

#include "report_properties.h"

#include <util/console.h>
#include <util/cout_message.h>

#include "console.h"

#include <iomanip>

void report_properties(const std::vector<propertyt> &properties)
Expand Down
2 changes: 1 addition & 1 deletion src/cprover/report_traces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Author: Daniel Kroening, [email protected]

#include "report_traces.h"

#include <util/console.h>
#include <util/format_expr.h>

#include "console.h"
#include "state.h"

#include <iomanip>
Expand Down
2 changes: 1 addition & 1 deletion src/cprover/solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Author: Daniel Kroening, [email protected]

#include "solver.h"

#include <util/console.h>
#include <util/cout_message.h>
#include <util/format_expr.h>
#include <util/std_expr.h>

#include "address_taken.h"
#include "console.h"
#include "counterexample_found.h"
#include "generalization.h"
#include "inductiveness.h"
Expand Down
2 changes: 1 addition & 1 deletion src/cprover/solver_progress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Author: Daniel Kroening, [email protected]

#include "solver_progress.h"

#include "console.h"
#include <util/console.h>

#include <iostream>

Expand Down
2 changes: 2 additions & 0 deletions src/util/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SRC = arith_tools.cpp \
c_types.cpp \
cmdline.cpp \
config.cpp \
console.cpp \
cout_message.cpp \
dstring.cpp \
endianness_map.cpp \
Expand All @@ -28,6 +29,7 @@ SRC = arith_tools.cpp \
fresh_symbol.cpp \
get_base_name.cpp \
get_module.cpp \
help_formatter.cpp \
identifier.cpp \
ieee_float.cpp \
interval_union.cpp \
Expand Down
7 changes: 0 additions & 7 deletions src/cprover/console.cpp → src/util/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,6 @@ std::size_t consolet::width()
return _width;
}

extern "C" int mk_wcwidth(wchar_t ucs);

int consolet::wcwidth(wchar_t ucs)
{
return mk_wcwidth(ucs);
}

consolet::redirectt::redirectt(
std::ostream &__console_out,
std::ostream &__console_err)
Expand Down
12 changes: 3 additions & 9 deletions src/cprover/console.h → src/util/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Author: Daniel Kroening, [email protected]
/// \file
/// Console

#ifndef CPROVER_CPROVER_CONSOLE_H
#define CPROVER_CPROVER_CONSOLE_H
#ifndef CPROVER_UTIL_CONSOLE_H
#define CPROVER_UTIL_CONSOLE_H

#include <cstddef>
#include <iosfwd>
Expand Down Expand Up @@ -66,12 +66,6 @@ class consolet

static std::size_t width();

// -1: not printable
// 0: no width
// 1: usual single width
// 2: double width
static int wcwidth(wchar_t);

// redirection
class redirectt
{
Expand All @@ -95,4 +89,4 @@ class consolet
static std::ostream *_err;
};

#endif // CPROVER_CPROVER_CONSOLE_H
#endif // CPROVER_UTIL_CONSOLE_H
File renamed without changes.
6 changes: 3 additions & 3 deletions src/cprover/help_formatter.h → src/util/help_formatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Author: Daniel Kroening, [email protected]
/// \file
/// Help Formatter

#ifndef CPROVER_CPROVER_HELP_FORMATTER_H
#define CPROVER_CPROVER_HELP_FORMATTER_H
#ifndef CPROVER_UTIL_HELP_FORMATTER_H
#define CPROVER_UTIL_HELP_FORMATTER_H

#include <iosfwd>
#include <string>
Expand Down Expand Up @@ -49,4 +49,4 @@ operator<<(std::ostream &out, const help_formattert &h)
return out;
}

#endif // CPROVER_CPROVER_HELP_FORMATTER_H
#endif // CPROVER_UTIL_HELP_FORMATTER_H