Skip to content

Commit 5026087

Browse files
committed
Merge remote-tracking branch 'smowton-nontg/sss_keep_identical_structs' into sss_temporary_merge
2 parents 2e722a3 + d940270 commit 5026087

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/util/simplify_expr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ bool simplify_exprt::simplify_typecast(exprt &expr)
261261
}
262262

263263
// eliminate redundant typecasts
264-
if(base_type_eq(expr.type(), expr.op0().type(), ns))
264+
if((!keep_identical_structs) && base_type_eq(expr.type(), expr.op0().type(), ns))
265265
{
266266
exprt tmp;
267267
tmp.swap(expr.op0());

src/util/simplify_expr_class.h

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class simplify_exprt
3838
public:
3939
explicit simplify_exprt(const namespacet &_ns):
4040
do_simplify_if(true),
41+
keep_identical_structs(false),
4142
ns(_ns)
4243
#ifdef DEBUG_ON_DEMAND
4344
, debug_on(false)
@@ -54,6 +55,7 @@ class simplify_exprt
5455
}
5556

5657
bool do_simplify_if;
58+
bool keep_identical_structs;
5759

5860
// These below all return 'true' if the simplification wasn't applicable.
5961
// If false is returned, the expression has changed.

0 commit comments

Comments
 (0)