aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-01-02 00:58:59 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-28 11:36:39 +0100
commite1e909ac779e8c5ee099965884a99b291791b1da (patch)
tree5eff998fd4009abab308025f21faa7f3fcb87356
parent540c2c4bf47f0c517c042ff689679b2900bb36a5 (diff)
downloadsparse-e1e909ac779e8c5ee099965884a99b291791b1da.tar.gz
let replace_with_pseudo() use kill_instruction()
In replace_with_pseudo(), the replaced instruction needs to be killed and for this contains ts own code. But this is a duplication of what is already done in kill_instruction(). So, replace this part of the code by a cal to kill_instruction(). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--simplify.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/simplify.c b/simplify.c
index de03d315..29b368e9 100644
--- a/simplify.c
+++ b/simplify.c
@@ -445,23 +445,7 @@ static inline int replace_pseudo(struct instruction *insn, pseudo_t *pp, pseudo_
static int replace_with_pseudo(struct instruction *insn, pseudo_t pseudo)
{
convert_instruction_target(insn, pseudo);
-
- switch (insn->opcode) {
- case OP_SEL:
- case OP_RANGE:
- kill_use(&insn->src3);
- case OP_BINARY ... OP_BINCMP_END:
- kill_use(&insn->src2);
- case OP_UNOP ... OP_UNOP_END:
- case OP_SYMADDR:
- kill_use(&insn->src1);
- break;
-
- default:
- assert(0);
- }
- insn->bb = NULL;
- return REPEAT_CSE;
+ return kill_instruction(insn);
}
static inline int replace_with_value(struct instruction *insn, long long val)