aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-03-21 15:37:53 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-03-21 16:05:22 +0100
commit438393f490d6f5b773c9074880e3a8ae3b37f842 (patch)
treed00e0bc3548a6c0221b180ffd52f8359d5687cb2
parent9794908e1ad570920c470a8c817abbc3b195b876 (diff)
downloadsparse-438393f490d6f5b773c9074880e3a8ae3b37f842.tar.gz
replace add_instruction_to_end() by insert_last_instruction()
add_instruction_to_end() and insert_last_instruction() do exactly the same thing but with the arguments in the opposite order. So, replace add_instruction_to_end() by insert_last_instruction(). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--cse.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/cse.c b/cse.c
index 1e58a973..b5958181 100644
--- a/cse.c
+++ b/cse.c
@@ -298,14 +298,6 @@ static inline void remove_instruction(struct instruction_list **list, struct ins
delete_ptr_list_entry((struct ptr_list **)list, insn, count);
}
-static void add_instruction_to_end(struct instruction *insn, struct basic_block *bb)
-{
- struct instruction *br = delete_last_instruction(&bb->insns);
- insn->bb = bb;
- add_instruction(&bb->insns, insn);
- add_instruction(&bb->insns, br);
-}
-
static struct instruction * try_to_cse(struct entrypoint *ep, struct instruction *i1, struct instruction *i2)
{
struct basic_block *b1, *b2, *common;
@@ -343,7 +335,7 @@ static struct instruction * try_to_cse(struct entrypoint *ep, struct instruction
if (common) {
i1 = cse_one_instruction(i2, i1);
remove_instruction(&b1->insns, i1, 1);
- add_instruction_to_end(i1, common);
+ insert_last_instruction(common, i1);
} else {
i1 = i2;
}