Skip to content

Commit e44a9ab

Browse files
authored
Merge pull request #3290 from tautschnig/move-flatten-byte-ops
Move flatten_byte_* to lowering [blocks: #2068, #2501]
2 parents 1063983 + 57f8848 commit e44a9ab

File tree

8 files changed

+20
-38
lines changed

8 files changed

+20
-38
lines changed

src/solvers/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ SRC = $(BOOLEFORCE_SRC) \
138138
flattening/bv_utils.cpp \
139139
flattening/c_bit_field_replacement_type.cpp \
140140
flattening/equality.cpp \
141-
flattening/flatten_byte_operators.cpp \
142141
flattening/functions.cpp \
143142
flattening/pointer_logic.cpp \
144143
floatbv/float_bv.cpp \
145144
floatbv/float_utils.cpp \
146145
floatbv/float_approximation.cpp \
146+
lowering/byte_operators.cpp \
147147
lowering/popcount.cpp \
148148
miniBDD/miniBDD.cpp \
149149
prop/bdd_expr.cpp \

src/solvers/flattening/boolbv_byte_extract.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ Author: Daniel Kroening, [email protected]
1616
#include <util/std_expr.h>
1717
#include <util/throw_with_nested.h>
1818

19+
#include <solvers/lowering/expr_lowering.h>
20+
#include <solvers/lowering/flatten_byte_extract_exceptions.h>
21+
1922
#include "bv_conversion_exceptions.h"
2023
#include "bv_endianness_map.h"
21-
#include "flatten_byte_extract_exceptions.h"
22-
#include "flatten_byte_operators.h"
2324

2425
bvt map_bv(const bv_endianness_mapt &map, const bvt &src)
2526
{

src/solvers/flattening/boolbv_equality.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ Author: Daniel Kroening, [email protected]
1212
#include <util/base_type.h>
1313
#include <util/invariant.h>
1414

15+
#include <solvers/lowering/expr_lowering.h>
16+
1517
#include "bv_conversion_exceptions.h"
16-
#include "flatten_byte_operators.h"
1718

1819
literalt boolbvt::convert_equality(const equal_exprt &expr)
1920
{

src/solvers/flattening/flatten_byte_operators.h

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/solvers/flattening/flatten_byte_operators.cpp renamed to src/solvers/lowering/byte_operators.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Author: Daniel Kroening, [email protected]
66
77
\*******************************************************************/
88

9-
#include "flatten_byte_operators.h"
9+
#include "expr_lowering.h"
1010

1111
#include <util/arith_tools.h>
1212
#include <util/byte_operators.h>
@@ -18,6 +18,8 @@ Author: Daniel Kroening, [email protected]
1818

1919
#include "flatten_byte_extract_exceptions.h"
2020

21+
// clang-format off
22+
2123
/// rewrite an object into its individual bytes
2224
/// \par parameters: src object to unpack
2325
/// little_endian true, iff assumed endianness is little-endian
@@ -664,3 +666,4 @@ exprt flatten_byte_operators(
664666
else
665667
return tmp;
666668
}
669+
// clang-format on

src/solvers/lowering/expr_lowering.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,19 @@ Author: Michael Tautschnig
1111

1212
#include <util/expr.h>
1313

14+
class byte_extract_exprt;
15+
class byte_update_exprt;
1416
class namespacet;
1517
class popcount_exprt;
1618

19+
exprt flatten_byte_extract(const byte_extract_exprt &src, const namespacet &ns);
20+
21+
exprt flatten_byte_update(const byte_update_exprt &src, const namespacet &ns);
22+
23+
exprt flatten_byte_operators(const exprt &src, const namespacet &ns);
24+
25+
bool has_byte_operator(const exprt &src);
26+
1727
/// Lower a popcount_exprt to arithmetic and logic expressions
1828
/// \param expr Input expression to be translated
1929
/// \param ns Namespace for type lookups

src/solvers/smt2/smt2_conv.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Author: Daniel Kroening, [email protected]
2828

2929
#include <solvers/flattening/boolbv_width.h>
3030
#include <solvers/flattening/c_bit_field_replacement_type.h>
31-
#include <solvers/flattening/flatten_byte_operators.h>
3231
#include <solvers/floatbv/float_bv.h>
3332
#include <solvers/lowering/expr_lowering.h>
3433

0 commit comments

Comments
 (0)