From 8af0e8a2ebcf53dde914c9e84f09bc0c46d73d81 Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Sat, 20 Feb 2021 06:26:59 +0100 Subject: reorg dominates() To prepare the handling of OP_ASM instructions, reorganize the opcode tests to use a switch. Signed-off-by: Luc Van Oostenryck --- flow.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flow.c b/flow.c index bda277aa..5751ce75 100644 --- a/flow.c +++ b/flow.c @@ -490,12 +490,15 @@ static inline int distinct_symbols(pseudo_t a, pseudo_t b) */ int dominates(pseudo_t pseudo, struct instruction *insn, struct instruction *dom, int local) { - int opcode = dom->opcode; - - if (opcode == OP_CALL || opcode == OP_ENTRY) + switch (dom->opcode) { + case OP_CALL: case OP_ENTRY: return local ? 0 : -1; - if (opcode != OP_LOAD && opcode != OP_STORE) + case OP_LOAD: case OP_STORE: + break; + default: return 0; + } + if (dom->src != pseudo) { if (local) return 0; -- cgit 1.2.3-korg