aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/opcode.def
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-21 13:09:36 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-21 23:05:03 +0100
commit45e0e859a9cf2d14546dd5597a777926087928f0 (patch)
treeae6bd62a48241896b4708b704f37251973aecd50 /opcode.def
parent1221dc1c8c4299c57bb53a7b0b8a8e4e8729f9d6 (diff)
downloadsparse-dev-45e0e859a9cf2d14546dd5597a777926087928f0.tar.gz
add a new instruction for label-as-value
Convert OP_SETVAL of a label into a new instruction: OP_LABEL. There is 2 reasons to do this: *) there is slightly less checking to be done in later phases (since OP_SETVAL can be for labels but also strings) *) OP_SETVAL is CSEd but this is largely useless because this instruction is hashed on the expression's address and these are (most) often not shared. With a separate instruction for label expressions, their CSE is now OK because the hashing is done on the BB. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'opcode.def')
-rw-r--r--opcode.def1
1 files changed, 1 insertions, 0 deletions
diff --git a/opcode.def b/opcode.def
index 2627abd4..ba757dae 100644
--- a/opcode.def
+++ b/opcode.def
@@ -98,6 +98,7 @@ OPCODE(STORE, BADOP, BADOP, BADOP, BADOP, 1, OPF_NONE)
/* Other */
OPCODE(PHISOURCE, BADOP, BADOP, BADOP, BADOP, 1, OPF_TARGET)
OPCODE(PHI, BADOP, BADOP, BADOP, BADOP, 0, OPF_TARGET)
+OPCODE(LABEL, BADOP, BADOP, BADOP, BADOP, 0, OPF_TARGET)
OPCODE(SETVAL, BADOP, BADOP, BADOP, BADOP, 0, OPF_TARGET)
OPCODE(SETFVAL, BADOP, BADOP, BADOP, BADOP, 0, OPF_TARGET)
OPCODE(CALL, BADOP, BADOP, BADOP, BADOP, 1, OPF_TARGET)