qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit 6e70be3f22f85b02cdc30ef506f289b2700ca986
parent b58fdfec9dfbbb870552e4b50d34e8cba4ffc288
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Tue, 12 Apr 2016 10:49:56 -0400

simplify fillpreds() code

Diffstat:
Mssa.c | 9++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/ssa.c b/ssa.c @@ -87,16 +87,11 @@ filluse(Fn *fn) static void addpred(Blk *bp, Blk *bc) { - uint i; - if (!bc->pred) { bc->pred = alloc(bc->npred * sizeof bc->pred[0]); - for (i=0; i<bc->npred; i++) - bc->pred[i] = 0; + bc->visit = 0; } - for (i=0; bc->pred[i]; i++) - ; - bc->pred[i] = bp; + bc->pred[bc->visit++] = bp; } /* fill predecessors information in blocks