-
Notifications
You must be signed in to change notification settings - Fork 273
Fix building without USE_DSTRING #1845
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d87d6e4
Include unordered_map where using a std::unordered_map
tautschnig 534f4d2
Include list in expr.h
tautschnig 25ffad4
Do not use dstringt-specific APIs with irep_idt
tautschnig 52290b0
Include string when not using dstringt as irep_idt representation
tautschnig 590fc2d
Make USE_DSTRING conditional and disable it in Ubuntu/Clang/DEBUG Tra…
tautschnig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include <util/irep.h> | ||
|
||
#include <unordered_map> | ||
|
||
enum class ansi_c_id_classt | ||
{ | ||
ANSI_C_UNKNOWN, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include <util/invariant.h> | ||
#include <util/std_types.h> | ||
#include <util/string_container.h> | ||
#include <util/symbol_table.h> | ||
#include <util/ieee_float.h> | ||
#include <util/fixedbv.h> | ||
|
@@ -642,7 +643,7 @@ exprt interpretert::get_value( | |
{ | ||
// Strings are currently encoded by their irep_idt ID. | ||
return constant_exprt( | ||
irep_idt::make_from_table_index(rhs[integer2size_t(offset)].to_long()), | ||
get_string_container().get_string(rhs[integer2size_t(offset)].to_long()), | ||
type); | ||
} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ Author: Daniel Kroening, [email protected] | |
#include <util/invariant.h> | ||
#include <util/fixedbv.h> | ||
#include <util/std_expr.h> | ||
#include <util/string_container.h> | ||
#include <util/pointer_offset_size.h> | ||
|
||
#include <langapi/language_util.h> | ||
|
@@ -394,7 +395,7 @@ void interpretert::evaluate( | |
if(show) | ||
warning() << "string decoding not fully implemented " | ||
<< length << eom; | ||
mp_integer tmp=value.get_no(); | ||
mp_integer tmp = get_string_container()[id2string(value)]; | ||
dest.push_back(tmp); | ||
return; | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,8 @@ Author: Michael Tautschnig, [email protected] | |
|
||
#include <solvers/miniBDD/miniBDD.h> | ||
|
||
#include <unordered_map> | ||
|
||
class namespacet; | ||
|
||
/*! \brief TO_BE_DOCUMENTED | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ Author: Daniel Kroening, [email protected] | |
#include <functional> | ||
#include "type.h" | ||
|
||
#include <list> | ||
|
||
#define forall_operands(it, expr) \ | ||
if((expr).has_operands()) /* NOLINT(readability/braces) */ \ | ||
for(exprt::operandst::const_iterator it=(expr).operands().begin(), \ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,10 +12,14 @@ Author: Reuben Thomas, [email protected] | |
#ifndef CPROVER_UTIL_IREP_IDS_H | ||
#define CPROVER_UTIL_IREP_IDS_H | ||
|
||
#ifndef USE_STD_STRING | ||
#define USE_DSTRING | ||
#endif | ||
|
||
#ifdef USE_DSTRING | ||
#include "dstring.h" | ||
#else | ||
#include <string> | ||
#endif | ||
|
||
/// \file The irep_ids are generated using a technique called | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "expr.h" | ||
|
||
#include <unordered_map> | ||
|
||
typedef std::unordered_map<exprt, exprt, irep_hash> replace_mapt; | ||
|
||
bool replace_expr(const exprt &what, const exprt &by, exprt &dest); | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "expr.h" | ||
|
||
#include <unordered_map> | ||
|
||
class replace_symbolt | ||
{ | ||
public: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,8 @@ Author: Daniel Kroening, [email protected] | |
#include "invariant.h" | ||
#include "expr_cast.h" | ||
|
||
#include <unordered_map> | ||
|
||
class constant_exprt; | ||
|
||
/*! \defgroup gr_std_types Conversion to specific types | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid the rather ugly perl in the travis config change that is part of this PR, is it worth considering tweaking the
#define USE_DSTRING
here to do something like:Then the travis builds could just add
-DNO_USE_DSTRING
to the CXX_FLAGS?I suppose also that if this change is made, it might be worth a quick update to
doc/architectural/cbmc-guide.md
as well, since that mentionsUSE_DSTRING
briefly...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now added
USE_STD_STRING
to guardUSE_STRING
in the way you suggested, and thus also got rid of the ugly perl hack.