From 36de4f902c4eec9f8d918e00cf0bf89d6b670cf5 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Wed, 3 Apr 2024 16:00:15 +0300 Subject: add ssa form --- src/parser.y | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/parser.y') diff --git a/src/parser.y b/src/parser.y index 4edcdcf..ec133eb 100644 --- a/src/parser.y +++ b/src/parser.y @@ -157,7 +157,15 @@ static inline void do_new_block(struct parser *p, const char *label) { finish_block(p->b, type, a0, a1, label); - p->b = p->b->s1 = new_block(p->f); + struct blk *b = new_block(p->f); + + if (p->b->btype == RET) + p->b = b; + /* kind of a special case, a jump to the direct next block */ + else if (p->b->btype == J && label == NULL) + p->b = p->b->s1 = p->b->s2 = b; + else + p->b = p->b->s1 = b; } static inline void do_insadd(struct parser *p, -- cgit v1.3