aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linearize.h
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-22 09:08:53 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-23 07:43:54 +0200
commitfa70d690d245b4e315472e20c529afd1b55290af (patch)
treef7fd170142f846fcbd59f5698a622149031186ee /linearize.h
parentf46413ad4762335af4d3631636e6015c6501877a (diff)
downloadsparse-dev-fa70d690d245b4e315472e20c529afd1b55290af.tar.gz
ir: define an OP_... range for unops
Some operations are exactly the same for all unops, including casts. To make things more readable and decrease the amount of churn, create a range OP_UNOP - OP_UNOP_END like already done for binops. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'linearize.h')
-rw-r--r--linearize.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/linearize.h b/linearize.h
index db4a67f3..5e8fb1fa 100644
--- a/linearize.h
+++ b/linearize.h
@@ -215,10 +215,18 @@ enum opcode {
OP_BINCMP_END = OP_SET_AE,
/* Uni */
- OP_NOT,
+ OP_UNOP,
+ OP_NOT = OP_UNOP,
OP_NEG,
OP_FNEG,
+ /* Casts */
+ OP_CAST,
+ OP_SCAST,
+ OP_FPCAST,
+ OP_PTRCAST,
+ OP_UNOP_END = OP_PTRCAST,
+
/* Select - three input values */
OP_SEL,
@@ -232,10 +240,6 @@ enum opcode {
/* Other */
OP_PHI,
OP_PHISOURCE,
- OP_CAST,
- OP_SCAST,
- OP_FPCAST,
- OP_PTRCAST,
OP_INLINED_CALL,
OP_CALL,
OP_SLICE,