Skip to content

Consistently disable simplify_exprt::local_replace_map #2060

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
Apr 16, 2018
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
8 changes: 5 additions & 3 deletions src/util/simplify_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ bool simplify_exprt::simplify_if_preorder(if_exprt &expr)
result=false;
}

#if 0
#ifdef USE_LOCAL_REPLACE_MAP
replace_mapt map_before(local_replace_map);

// a ? b : c --> a ? b[a/true] : c
Expand Down Expand Up @@ -1109,10 +1109,10 @@ bool simplify_exprt::simplify_if_preorder(if_exprt &expr)
result=simplify_rec(falsevalue) && result;

local_replace_map.swap(map_before);
#else
#else
result=simplify_rec(truevalue) && result;
result=simplify_rec(falsevalue) && result;
#endif
#endif
}
else
{
Expand Down Expand Up @@ -2382,6 +2382,7 @@ bool simplify_exprt::simplify_rec(exprt &expr)
if(!simplify_node(tmp))
result=false;

#ifdef USE_LOCAL_REPLACE_MAP
#if 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Therefore remove this #if 1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, there is still the alternative within this bit of code (it's part of an #if 1 ... #else ... #endif) so I don't think it should be removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

OK didn't see that in the diff, thought the #if 1 was being replaced like the #if 0 above

replace_mapt::const_iterator it=local_replace_map.find(tmp);
if(it!=local_replace_map.end())
Expand All @@ -2397,6 +2398,7 @@ bool simplify_exprt::simplify_rec(exprt &expr)
result=false;
}
#endif
#endif

if(!result)
{
Expand Down
5 changes: 5 additions & 0 deletions src/util/simplify_expr_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ Author: Daniel Kroening, [email protected]

#include "type.h"
#include "mp_arith.h"
// #define USE_LOCAL_REPLACE_MAP
#ifdef USE_LOCAL_REPLACE_MAP
#include "replace_expr.h"
#endif

class bswap_exprt;
class byte_extract_exprt;
Expand Down Expand Up @@ -154,7 +157,9 @@ class simplify_exprt
#ifdef DEBUG_ON_DEMAND
bool debug_on;
#endif
#ifdef USE_LOCAL_REPLACE_MAP
replace_mapt local_replace_map;
#endif
};

#endif // CPROVER_UTIL_SIMPLIFY_EXPR_CLASS_H