aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/opcode.h
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-09-20 01:03:33 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-10-20 22:35:08 +0200
commite51008eb29ccb75e2e58f5d9c545f944185c9765 (patch)
treefb97da6f942e119d39f83db5a53f02a808fe6a9d /opcode.h
parentce5f04a050cbc8bd92f718765616199a7f8c958a (diff)
downloadsparse-dev-e51008eb29ccb75e2e58f5d9c545f944185c9765.tar.gz
add a flag to identify commutative & associative ops
The way how the functions doing the simplification of commutative or associative binops are called is simple but complicates the simplification of a specific binop. Fix this by adding a flag to the opcode table to identify the commutative and the associative binops and using this flag to call or not the functions doing the corresponding simplification. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'opcode.h')
-rw-r--r--opcode.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/opcode.h b/opcode.h
index e426bed4..bb94ec81 100644
--- a/opcode.h
+++ b/opcode.h
@@ -20,6 +20,11 @@ extern const struct opcode_table {
unsigned int flags:6;
#define OPF_NONE 0
#define OPF_TARGET (1 << 0)
+#define OPF_COMMU (1 << 1)
+#define OPF_ASSOC (1 << 2)
+#define OPF_UNOP (1 << 3)
+#define OPF_BINOP (1 << 4)
+#define OPF_COMPARE (1 << 5)
} opcode_table[];