From e6fbab42185f4fb4e3a3b1e3e93eaa5d3d81b7c7 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 20 Dec 2025 17:59:40 +0100 Subject: backend: unify pass memory allocation strategies It was all over the place for temporary data structures used by individual passes. Now there is an arena specifically for that, which is nicer. --- ir/simpl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ir/simpl.c') diff --git a/ir/simpl.c b/ir/simpl.c index fb89c07..7e6cfd0 100644 --- a/ir/simpl.c +++ b/ir/simpl.c @@ -70,7 +70,7 @@ simpl(struct function *fn) FREQUIRE(FNUSE); int inschange = 0, blkchange = 0; - struct block **jmpfinal = xcalloc(fn->nblk * sizeof *jmpfinal); + struct block **jmpfinal = allocz(fn->passarena, fn->nblk * sizeof *jmpfinal, 0); struct block *blk = fn->entry; do { @@ -140,7 +140,6 @@ simpl(struct function *fn) } while ((blk = blk->lnext) != fn->entry); fillpreds(fn); } - free(jmpfinal); } /* vim:set ts=3 sw=3 expandtab: */ -- cgit v1.2.3