Skip to content

gcc style error messages for goto-cc #463

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

Closed
wants to merge 169 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
c0fda23
gcc style error messages for goto-cc
Jan 22, 2017
bfca2d5
merge
Jan 22, 2017
9a61c2c
fix for multi-ary fixed-bv multiplication
Jan 22, 2017
f1df0be
fix for multi-ary fixed-bv multiplication
Jan 22, 2017
7f33f04
Added CEGIS control benchmark 4
pkesseli Jan 22, 2017
940eb34
Generalise dominators template (#422)
smowton Jan 23, 2017
649d928
Implement local variable live range merging
smowton Dec 13, 2016
ac93ee3
Replace old variable table implementation
smowton Jan 19, 2017
23f7d81
Factor the jbcm type and LVT functions into individual files
smowton Jan 19, 2017
0610bae
Use a total order when top-sorting variables
smowton Oct 26, 2016
5f740c6
Local variable table: tolerate impossible flows
smowton Dec 1, 2016
923b7ab
Fix hole-in-variable-live-range test
smowton Dec 5, 2016
41d2b27
Style fixes
smowton Jan 19, 2017
b309f06
Add documentation
smowton Jan 19, 2017
7372e8f
Add tests for local variable live ranges with holes
smowton Dec 7, 2016
e12cf9b
Cleanup of operands() accesses
tautschnig Jan 21, 2014
85118e1
Consistently resize instead of just reserving in codet classes
tautschnig Jan 18, 2017
bce928f
Fix package_friendly1 test
smowton Jan 23, 2017
e647aaf
Enable Java regression tests
smowton Jan 23, 2017
7c2e95a
Fixed CEGIS control vector solution nondet
pkesseli Jan 23, 2017
1a9c2b3
Fixed nondet returns in benchmark
pkesseli Jan 23, 2017
76cf8be
Fixing simple linting errors in CVC
Jan 10, 2017
0196734
Split convert_expr into a collection of smaller functions
Jan 10, 2017
43b95ca
Replaced loop with simpler expression
Jan 20, 2017
704ed4f
Replaced a for loop with a ranged based for loop
Jan 20, 2017
0f80ad4
Parse the exception table
smowton Sep 23, 2016
bf0332d
Make the method object, and thus the exception table, available to do…
smowton Jan 23, 2017
974ee14
Add exception edges to the CFG for dominator computation
smowton Sep 23, 2016
bcbb13a
Style fixes for local variable table
smowton Jan 23, 2017
031001b
Make JAR/zip support optional in regression tests
tautschnig Jan 23, 2017
017d854
fixup! Consistently resize instead of just reserving in codet classes
tautschnig Jan 23, 2017
60a1fb2
Don't reference CPROVER_memory from Java code. Fixes #197.
smowton Aug 31, 2016
aff699d
Make symex language mode symbol clearer
smowton Dec 5, 2016
0293309
Add comment that goto_program_dereference doesn't specify language mode
smowton Dec 5, 2016
0c8aedc
Don't use potentially-invalid downcasts to read an object's clsid if …
smowton Aug 23, 2016
96b386f
Include child types when creating a virtual function dispatch tree
smowton Sep 9, 2016
1062f5c
Call least-derived virtual function for unknown clsid
smowton Sep 9, 2016
e73226c
Add test for virtual dispatch against child type
smowton Dec 14, 2016
5e774da
Style and documentation fixes
smowton Jan 4, 2017
6fb9cf2
fixup! wmm/musketeer: Use wmm_grapht::node_indext instead of unsigned
tautschnig Jan 16, 2017
d15e106
cegis uses labels for marking instructions
tautschnig Jan 18, 2017
5b4f2ac
std::string::c_str() is non-const on Mac OS
tautschnig Jan 18, 2017
a2d8585
cegis: remove unused variables and namespace-local functions
tautschnig Jan 18, 2017
18e1579
Make unused return value explicit in source
tautschnig Jan 24, 2017
1c74b6b
cegis: uniform copyright headers, added missing ones
tautschnig Jan 25, 2017
5863454
cegis: fix include guards to match coding conventions
tautschnig Jan 25, 2017
fabac07
clobber: update to current APIs
tautschnig Jan 18, 2017
40413ed
memory-models: Use ID_c_enum as ID_enum no longer exists
tautschnig Jan 18, 2017
ac36bea
Merge improvements from aa-symex
tautschnig Jan 18, 2017
72c9b77
aa-symex: share files with symex, path-symex
tautschnig Jan 18, 2017
f3969d0
Support building aa-symex, clobber, memory-model
tautschnig Jan 18, 2017
3f244b3
Revert "also don't build memory-models.dir and clobber.dir"
tautschnig Jan 17, 2017
2e98e10
Revert "do not build aa-symex.dir"
tautschnig Jan 17, 2017
dcc4260
Fix address space limit test. Fixes #243
smowton Sep 30, 2016
071a0b1
Add address space size limit regression test
smowton Jan 25, 2017
de84fe1
restructure expr2java
mgudemann Nov 3, 2016
7aef6ae
pre-load java.lang.Object / String in class queue
mgudemann Nov 4, 2016
aa45937
correct array type for Java
mgudemann Nov 3, 2016
8620cee
nondeterministic initialization
mgudemann Dec 6, 2016
8431204
exception table parser
mgudemann Nov 4, 2016
c3fdd43
handle java.lang.String literals
mgudemann Nov 4, 2016
385521a
handle array length and runtime checks for Java
mgudemann Nov 4, 2016
11be193
Java assertion handling
mgudemann Nov 4, 2016
09c6304
class conversion runtime checks / array handling
mgudemann Nov 4, 2016
8877d75
java bytecode index in source location
mgudemann Nov 4, 2016
f8f8889
Correct parsing / generation of source filename
mgudemann Nov 4, 2016
a981430
Clean up Java pointer cast handling
Jan 11, 2017
ba45b55
extract java bytecode convert method class
mgudemann Nov 11, 2016
6f6d613
Java entry point / main function
Jan 11, 2017
50089af
Correct java type width handling
mgudemann Dec 19, 2016
51999dc
pacify cpplint
mgudemann Jan 13, 2017
b8cc294
take comments into account
mgudemann Jan 13, 2017
6ea64f1
fix linter warnings after rebase
mgudemann Jan 15, 2017
8d32fc7
remove static method is_string_array
mgudemann Jan 15, 2017
f454ed8
take comments into account
mgudemann Jan 15, 2017
47bd670
remove cast_if_necessary
mgudemann Jan 20, 2017
2599f40
is_constructor and is_virtual as class methods
mgudemann Jan 20, 2017
6c65dd7
make param const reference in clean_deref
mgudemann Jan 15, 2017
abccf9e
irep ID_java_super_method_call
mgudemann Jan 15, 2017
281905f
comments for java object factory
mgudemann Jan 15, 2017
d6f6b64
documentation block gen_nondeet_array_init
mgudemann Jan 15, 2017
520cfcc
remove default values from object factory
mgudemann Jan 15, 2017
64d2f1e
export as_number to java_utils.cpp
mgudemann Jan 17, 2017
ecb6cca
take tautschnig's comments into account
mgudemann Jan 20, 2017
06942df
remove namespace from vtable
mgudemann Jan 23, 2017
7d2a303
remove const_cast
mgudemann Jan 23, 2017
f73048f
add java_utils.cpp
mgudemann Jan 23, 2017
a0e5510
Peter's comments
mgudemann Jan 23, 2017
51751ce
remove superfluous std::move from conversion
mgudemann Jan 23, 2017
85de00e
adapt NullPointer[1-4] regression tests
mgudemann Jan 23, 2017
494436a
default ctor for java_convert_methodt::variablet
mgudemann Jan 23, 2017
c54f78a
take tautschnig's comments into account
mgudemann Jan 23, 2017
1aa5bfd
assert known Java object size
mgudemann Jan 24, 2017
7c89802
remove unused skip_initialize
mgudemann Jan 24, 2017
950a202
remove TODOs from expr2java
mgudemann Jan 24, 2017
e3cf2ce
beautification
mgudemann Jan 24, 2017
48b00d6
change "* "->" *", too
mgudemann Jan 24, 2017
8786af7
adapt NullPointer2 regression test
mgudemann Jan 25, 2017
4669ef3
adapt interface in CEGIS with default values
mgudemann Jan 25, 2017
0230b0d
whitespace in front of {
mgudemann Jan 25, 2017
fcbd267
get_language options to language API (#480)
mgudemann Jan 30, 2017
a2010c8
Added check for div by zero in CEGIS control rational back end.
pkesseli Jan 30, 2017
70acc40
missing header for S_IRUSR
Jan 30, 2017
718f10f
Factor class identifier extraction out of remove virtuals
smowton Jan 25, 2017
c85f573
Remove virtuals style improvements
smowton Jan 26, 2017
c83c5cc
Discover lexical scopes for anonymous variables
smowton Jan 24, 2017
04f6998
Add test for anonymous local scoping
smowton Jan 24, 2017
175bc4e
Replace gen_zero/gen_one by from_integer where possible
tautschnig Jan 16, 2017
230dc50
Use null_pointer_exprt instead of gen_zero
tautschnig Jan 16, 2017
c37c089
zero_initializer without message_handlert
tautschnig Jan 16, 2017
e304bad
Use zero_initializer instead of gen_zero
tautschnig Jan 16, 2017
33b45d3
Added file copyright header as noted by linter
tautschnig Jan 21, 2017
a9752cc
cbmc-java: Print details of errors in regression tests
tautschnig Jan 27, 2017
b083cf5
Make from_integer fail an assertion for unsupported types
tautschnig Jan 27, 2017
d36aa5a
Makefile tweaks to enable re-use of Makefiles in vpath builds
tautschnig Jan 21, 2017
6a7a64c
Script to prepare out-of-tree (aka vpath) builds
tautschnig Jan 21, 2017
99d53d9
Use vpath builds for coverage measurement
tautschnig Jan 21, 2017
a7a4ebb
ignore recursion set if class is subtype
mgudemann Dec 15, 2016
9f37ed4
loop unwinding in static init of Java enum
mgudemann Jan 20, 2017
0bbb638
Keep SSA L1 IDs as an attribute
smowton Sep 16, 2016
ebe9f2e
Replaced all instances of show-goto-functions a define
Jan 18, 2017
ddc75af
Renamed the GOTO_CHECK defintions according to the new naming convention
Jan 19, 2017
712fed1
Do not add named vars to used_local_names
smowton Jan 31, 2017
edf0edd
CPPlint on travis change: it will run, but not produce errors. (#473)
forejtv Jan 31, 2017
b6a5436
Mark internal functions static
tautschnig Jun 26, 2016
4adb505
remove_complex: modify expressions only when necessary
tautschnig Jun 26, 2016
a7c6880
remove_vector: modify expressions only when necessary
tautschnig Jun 26, 2016
d38ccff
Apply adjust_float_expressions, rewrite_union just once per expression
tautschnig Jun 25, 2016
db2f6a4
rewrite_union, adjust_float_expressions: modify expressions only when…
tautschnig Jun 26, 2016
36c87d9
Add remove_instanceof pass
smowton Dec 14, 2016
2e56672
Use container-based Travis builds (#488)
tautschnig Feb 2, 2017
cef4870
Make the pre-commit hook report non-temporary path names (#477)
tautschnig Feb 2, 2017
ae3bb31
Keep track of types for structs and unions
Jan 26, 2017
ecf73db
Correcting test and adding to the suite
Jan 26, 2017
af84034
Added tests for different cases
Jan 26, 2017
332af10
Removed zip package
pkesseli Feb 3, 2017
7e8a2b3
specify initial values for Boolean in struct optiont
mgudemann Feb 3, 2017
294c7db
Additions to the gitignore
Feb 3, 2017
59996f7
initialize Boolean values in c_typecheck_baset
Feb 3, 2017
e24d992
add explicit undef value to format string enums
mgudemann Feb 3, 2017
bf09a0b
Use remove_instanceof in driver programs
smowton Dec 14, 2016
f25980c
Add instanceof test cases
smowton Feb 2, 2017
bf187ef
goto-instrument: remove virt calls and RTTI
smowton Feb 3, 2017
e9712bb
read ACC_ABSTRACT attribute in Java class files
Feb 2, 2017
8e54769
Check static array bounds of dynamic objects
smowton Oct 28, 2016
d8ba38f
mode!=ID_java is trivially true in this branch
tautschnig Jan 1, 2017
735900a
Limit dereferencing checks to actual access size
tautschnig Jan 2, 2017
af19303
Making check methods of refinement virtual
romainbrenguier Dec 23, 2016
3d1fa7a
Adding identifiers for string expressions and functions
romainbrenguier Dec 23, 2016
2da0f17
Added a to_unsigned_integer function to arith_tools
romainbrenguier Jan 24, 2017
edf57da
Class for string types used in the string solver
romainbrenguier Dec 23, 2016
651e53d
Class for string expressions to be used by the string solver
romainbrenguier Dec 23, 2016
f4fd79c
Class for string constraints.
romainbrenguier Dec 23, 2016
df336c3
Class for generating string constraints from string functions
romainbrenguier Dec 23, 2016
f7645ab
String refinement class
romainbrenguier Dec 23, 2016
0b2a5c1
Remove virtual functions: shorten dispatch table
smowton Nov 1, 2016
3f0a880
If the only dispatch option is abstract, erase the call
smowton Nov 3, 2016
e720837
Make test more tolerant of formatting differences
smowton Jan 31, 2017
48ffff3
Add test for vtable abbreviation
smowton Jan 31, 2017
49d1ae7
Add source locations to virt calls
smowton Feb 1, 2017
f84460d
Make string literal tables global
smowton Dec 6, 2016
b6b0063
Correct return value test of to_integer (#508)
allredj Feb 7, 2017
2ee34f3
Fixed use of inline
NathanJPhillips Jan 23, 2017
932ba57
Added regression tests for full-slice option
lucasccordeiro Jan 27, 2017
bbe8fcc
moved full-slice test cases from cbmc to goto-instrument
lucasccordeiro Feb 6, 2017
db88e7a
Fix adjustment of goto targets in the loop unwinder
danpoe Feb 7, 2017
adcd342
gcc style error messages for goto-cc
Jan 22, 2017
09f2d80
merge
Feb 8, 2017
09e7615
Merge branch 'master' into gcc-errors
Feb 8, 2017
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
13 changes: 13 additions & 0 deletions regression/cbmc/Fixedbv8/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
typedef __CPROVER_fixedbv[64][32] __plant_typet;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These regression tests seem to be unrelated to gcc.

extern __plant_typet A0, A1;

int main(void) {
__CPROVER_assume(A0 == (__plant_typet)0.125);
__CPROVER_assume(A1 == (__plant_typet)0.015625);

const __plant_typet XXX1a=A0 * A1;
const __plant_typet XXX2a=(__plant_typet)-1 * XXX1a;
const __plant_typet XXX2b=-0.001953125;
__CPROVER_assert(XXX2a==XXX2b, "");
return 0;
}
8 changes: 8 additions & 0 deletions regression/cbmc/Fixedbv8/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
main.c

^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
4 changes: 2 additions & 2 deletions src/goto-cc/armcc_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ int armcc_modet::doit()
if(cmdline.isset("verbosity"))
verbosity=unsafe_string2int(cmdline.get_value("verbosity"));

compiler.ui_message_handler.set_verbosity(verbosity);
ui_message_handler.set_verbosity(verbosity);
compiler.set_message_handler(get_message_handler());
message_handler.set_verbosity(verbosity);

debug() << "ARM mode" << eom;

Expand Down
9 changes: 6 additions & 3 deletions src/goto-cc/armcc_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,28 @@ Date: June 2006
#ifndef CPROVER_GOTO_CC_ARMCC_MODE_H
#define CPROVER_GOTO_CC_ARMCC_MODE_H

#include <util/cout_message.h>

#include "goto_cc_mode.h"
#include "armcc_cmdline.h"

class armcc_modet:public goto_cc_modet
{
public:
virtual int doit();
virtual void help_mode();
int doit() final;
void help_mode() final;

armcc_modet(
armcc_cmdlinet &_armcc_cmdline,
const std::string &_base_name):
goto_cc_modet(_armcc_cmdline, _base_name),
goto_cc_modet(_armcc_cmdline, _base_name, message_handler),
cmdline(_armcc_cmdline)
{
}

protected:
armcc_cmdlinet &cmdline;
gcc_message_handlert message_handler;
};

#endif // CPROVER_GOTO_CC_ARMCC_MODE_H
4 changes: 2 additions & 2 deletions src/goto-cc/as_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ as_modet::as_modet(
goto_cc_cmdlinet &_cmdline,
const std::string &_base_name,
bool _produce_hybrid_binary):
goto_cc_modet(_cmdline, _base_name),
goto_cc_modet(_cmdline, _base_name, message_handler),
produce_hybrid_binary(_produce_hybrid_binary),
native_tool_name(assembler_name(cmdline, base_name))
{
Expand Down Expand Up @@ -137,7 +137,7 @@ int as_modet::doit()
if(cmdline.isset("verbosity"))
verbosity=unsafe_string2unsigned(cmdline.get_value("verbosity"));

ui_message_handler.set_verbosity(verbosity);
message_handler.set_verbosity(verbosity);

if(act_as_as86)
{
Expand Down
5 changes: 4 additions & 1 deletion src/goto-cc/as_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Date: July 2016
#ifndef CPROVER_GOTO_CC_AS_MODE_H
#define CPROVER_GOTO_CC_AS_MODE_H

#include <util/cout_message.h>

#include "goto_cc_mode.h"

class as_modet:public goto_cc_modet
Expand All @@ -25,7 +27,8 @@ class as_modet:public goto_cc_modet
bool _produce_hybrid_binar);

protected:
bool produce_hybrid_binary;
gcc_message_handlert message_handler;
const bool produce_hybrid_binary;
const std::string native_tool_name;

int run_as(); // call as with original command line
Expand Down
4 changes: 2 additions & 2 deletions src/goto-cc/cw_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ int cw_modet::doit()
if(cmdline.isset("verbosity"))
verbosity=unsafe_string2unsigned(cmdline.get_value("verbosity"));

compiler.ui_message_handler.set_verbosity(verbosity);
ui_message_handler.set_verbosity(verbosity);
compiler.set_message_handler(get_message_handler());
message_handler.set_verbosity(verbosity);

debug() << "CodeWarrior mode" << eom;

Expand Down
5 changes: 4 additions & 1 deletion src/goto-cc/cw_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Date: June 2006
#ifndef CPROVER_GOTO_CC_CW_MODE_H
#define CPROVER_GOTO_CC_CW_MODE_H

#include <util/cout_message.h>

#include "goto_cc_mode.h"
#include "gcc_cmdline.h"

Expand All @@ -21,13 +23,14 @@ class cw_modet:public goto_cc_modet
virtual void help_mode();

cw_modet(gcc_cmdlinet &_gcc_cmdline, const std::string &_base_name):
goto_cc_modet(_gcc_cmdline, _base_name),
goto_cc_modet(_gcc_cmdline, _base_name, message_handler),
cmdline(_gcc_cmdline)
{
}

protected:
gcc_cmdlinet &cmdline;
console_message_handlert message_handler;
};

#endif // CPROVER_GOTO_CC_CW_MODE_H
6 changes: 3 additions & 3 deletions src/goto-cc/gcc_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ gcc_modet::gcc_modet(
goto_cc_cmdlinet &_cmdline,
const std::string &_base_name,
bool _produce_hybrid_binary):
goto_cc_modet(_cmdline, _base_name),
goto_cc_modet(_cmdline, _base_name, gcc_message_handler),
produce_hybrid_binary(_produce_hybrid_binary),
act_as_ld(base_name=="ld" ||
base_name.find("goto-ld")!=std::string::npos)
Expand Down Expand Up @@ -223,7 +223,7 @@ int gcc_modet::doit()
if(cmdline.isset("verbosity"))
verbosity=unsafe_string2unsigned(cmdline.get_value("verbosity"));

ui_message_handler.set_verbosity(verbosity);
gcc_message_handler.set_verbosity(verbosity);

if(act_as_ld)
{
Expand Down Expand Up @@ -303,7 +303,7 @@ int gcc_modet::doit()

// determine actions to be undertaken
compilet compiler(cmdline);
compiler.ui_message_handler.set_verbosity(verbosity);
compiler.set_message_handler(get_message_handler());

if(act_as_ld)
compiler.mode=compilet::LINK_LIBRARY;
Expand Down
8 changes: 6 additions & 2 deletions src/goto-cc/gcc_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,24 @@ Date: June 2006
#ifndef CPROVER_GOTO_CC_GCC_MODE_H
#define CPROVER_GOTO_CC_GCC_MODE_H

#include <util/cout_message.h>

#include "goto_cc_mode.h"

class gcc_modet:public goto_cc_modet
{
public:
virtual int doit();
virtual void help_mode();
int doit() final;
void help_mode() final;

gcc_modet(
goto_cc_cmdlinet &_cmdline,
const std::string &_base_name,
bool _produce_hybrid_binary);

protected:
gcc_message_handlert gcc_message_handler;

const bool produce_hybrid_binary;

const bool act_as_ld;
Expand Down
10 changes: 5 additions & 5 deletions src/goto-cc/goto_cc_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Function: goto_cc_modet::goto_cc_modet

goto_cc_modet::goto_cc_modet(
goto_cc_cmdlinet &_cmdline,
const std::string &_base_name):
language_uit(_cmdline, ui_message_handler),
ui_message_handler(_cmdline, "goto-cc " CBMC_VERSION),
base_name(_base_name),
cmdline(_cmdline)
const std::string &_base_name,
message_handlert &_message_handler):
messaget(_message_handler),
cmdline(_cmdline),
base_name(_base_name)
{
register_languages();
}
Expand Down
11 changes: 6 additions & 5 deletions src/goto-cc/goto_cc_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Date: June 2006

#include "goto_cc_cmdline.h"

class goto_cc_modet:public language_uit
class goto_cc_modet:public messaget
{
public:
virtual int main(int argc, const char **argv);
Expand All @@ -25,15 +25,16 @@ class goto_cc_modet:public language_uit
virtual void usage_error();

goto_cc_modet(
goto_cc_cmdlinet &_cmdline,
const std::string &_base_name);
goto_cc_cmdlinet &,
const std::string &_base_name,
message_handlert &);
~goto_cc_modet();

protected:
ui_message_handlert ui_message_handler;
goto_cc_cmdlinet &cmdline;
const std::string base_name;

void register_languages();
goto_cc_cmdlinet &cmdline;
};

#endif // CPROVER_GOTO_CC_GOTO_CC_MODE_H
4 changes: 2 additions & 2 deletions src/goto-cc/ms_cl_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ int ms_cl_modet::doit()
if(cmdline.isset("verbosity"))
verbosity=unsafe_string2unsigned(cmdline.get_value("verbosity"));

compiler.ui_message_handler.set_verbosity(verbosity);
ui_message_handler.set_verbosity(verbosity);
compiler.set_message_handler(get_message_handler());
message_handler.set_verbosity(verbosity);

debug() << "Visual Studio mode" << eom;

Expand Down
5 changes: 4 additions & 1 deletion src/goto-cc/ms_cl_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Date: June 2006
#ifndef CPROVER_GOTO_CC_MS_CL_MODE_H
#define CPROVER_GOTO_CC_MS_CL_MODE_H

#include <util/cout_message.h>

#include "goto_cc_mode.h"
#include "ms_cl_cmdline.h"

Expand All @@ -23,13 +25,14 @@ class ms_cl_modet:public goto_cc_modet
ms_cl_modet(
ms_cl_cmdlinet &_ms_cl_cmdline,
const std::string &_base_name):
goto_cc_modet(_ms_cl_cmdline, _base_name),
goto_cc_modet(_ms_cl_cmdline, _base_name, message_handler),
cmdline(_ms_cl_cmdline)
{
}

protected:
ms_cl_cmdlinet &cmdline;
console_message_handlert message_handler;
};

#endif // CPROVER_GOTO_CC_MS_CL_MODE_H
12 changes: 6 additions & 6 deletions src/solvers/flattening/boolbv_mult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ bvt boolbvt::convert_mult(const exprt &expr)
std::size_t fraction_bits=
to_fixedbv_type(expr.type()).get_fraction_bits();

// do a sign extension by fraction_bits bits
bv=bv_utils.sign_extension(bv, bv.size()+fraction_bits);

for(exprt::operandst::const_iterator it=operands.begin()+1;
it!=operands.end(); it++)
{
if(it->type()!=expr.type())
throw "multiplication with mixed types";

// do a sign extension by fraction_bits bits
bv=bv_utils.sign_extension(bv, bv.size()+fraction_bits);

bvt op=convert_bv(*it);

if(op.size()!=width)
Expand All @@ -70,10 +70,10 @@ bvt boolbvt::convert_mult(const exprt &expr)
op=bv_utils.sign_extension(op, bv.size());

bv=bv_utils.signed_multiplier(bv, op);
}

// cut it down again
bv.erase(bv.begin(), bv.begin()+fraction_bits);
// cut it down again
bv.erase(bv.begin(), bv.begin()+fraction_bits);
}

return bv;
}
Expand Down
65 changes: 65 additions & 0 deletions src/util/cout_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,68 @@ void console_message_handlert::print(
std::cerr << message << '\n' << std::flush;
#endif
}

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

Function: gcc_message_handlert::print

Inputs:

Outputs:

Purpose:

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

void gcc_message_handlert::print(
unsigned level,
const std::string &message,
int sequence_number,
const source_locationt &location)
{
std::string dest;

const irep_idt &file=location.get_file();
const irep_idt &line=location.get_line();
const irep_idt &function=location.get_function();

if(!function.empty())
{
if(!file.empty())
dest+=id2string(file)+":";
if(dest!="") dest+=' ';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put body of if on separate line

dest+="In function '"+id2string(function)+"':\n";
}

if(!line.empty())
{
if(!file.empty())
dest+=id2string(file)+":";

dest+=id2string(line)+":"+id2string(line)+":";
}

dest+=message;

print(level, dest);
}

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

Function: gcc_message_handlert::print

Inputs:

Outputs:

Purpose:

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

void gcc_message_handlert::print(
unsigned level,
const std::string &message)
{
// gcc appears to send everything to cerr
std::cerr << message << '\n' << std::flush;
}
Loading