aboutsummaryrefslogtreecommitdiff
path: root/src/parser.y
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-04-03 16:00:15 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-04-03 16:00:15 +0300
commit36de4f902c4eec9f8d918e00cf0bf89d6b670cf5 (patch)
tree6fc1a8f172ac018411f54b24b2d989992b20fe40 /src/parser.y
parenta7cb592efa9ec72c4c5e9d3c1e7469203a4b47e2 (diff)
downloadqbt-36de4f902c4eec9f8d918e00cf0bf89d6b670cf5.tar.gz
qbt-36de4f902c4eec9f8d918e00cf0bf89d6b670cf5.zip
add ssa form
Diffstat (limited to 'src/parser.y')
-rw-r--r--src/parser.y10
1 files changed, 9 insertions, 1 deletions
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,