summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/main.c b/main.c
index 89d1f3a..9fba001 100644
--- a/main.c
+++ b/main.c
@@ -240,14 +240,12 @@ void parse_if(Lexer *l, Proc *p) {
else if_true->type.lvl = T_XCTRL;
}
ctrl(p, if_true);
- //assert(if_true->in.len > 0);
lex_expected(l, TM_LBRACE);
int pos = l->pos.ofs;
parse_block(l, p, &scope_true);
if_true->src_pos = (LexSpan) { .ofs = pos, .n = l->pos.ofs - pos };
ctrl_if = p->ctrl;
node_add(p, ctrl_if, p->keepalive);
- //assert(ctrl_if->in.len > 0);
if (l->tok == TOK_ELSE) {
for (int i = 0; i < scope_before.len; i++) {
scope_update(scope_find(&p->scope, scope_before.data[i].name), scope_before.data[i].node, p);
@@ -260,12 +258,8 @@ void parse_if(Lexer *l, Proc *p) {
ctrl_else = p->ctrl;
node_add(p, ctrl_else, p->keepalive);
}
- Node *ctrl_was = p->ctrl;
- //node_add(p, ctrl_was, p->keepalive);
Node *region;
if (ctrl_else) {
- //assert(ctrl_if->in.len > 0);
- //assert(ctrl_else->in.len > 0);
assert(ctrl_if);
assert(ctrl_else);
region = node_new(p, N_REGION, ctrl_if, ctrl_else);
@@ -273,8 +267,6 @@ void parse_if(Lexer *l, Proc *p) {
node_remove(p, ctrl_if, p->keepalive);
node_remove(p, ctrl_else, p->keepalive);
} else {
- //assert(ctrl_if->in.len > 0);
- //assert(if_false->in.len > 0);
assert(ctrl_if);
assert(if_false);
region = node_new(p, N_REGION, ctrl_if, if_false);
@@ -286,7 +278,6 @@ void parse_if(Lexer *l, Proc *p) {
ctrl(p, region);
node_remove(p, if_true, p->keepalive);
node_remove(p, if_false, p->keepalive);
- //p->ctrl = node_peephole(node_new(p, N_REGION, if_true, if_false), p, l);
assert(p->ctrl->in.len > 0);
assert(region->in.data[0]);
assert(region->in.data[1]);
@@ -295,7 +286,6 @@ void parse_if(Lexer *l, Proc *p) {
scope_uncollect(&p->scope, p, &scope_false);
scope_uncollect(&p->scope, p, &scope_before);
node_del_out(region, p->keepalive);
- //assert(p->ctrl == region);
/* make sure we're not orphaning any phi nodes*/
if (p->ctrl->out.len < 1) {
ctrl(p, node_peephole(p->ctrl, p, l));
@@ -432,11 +422,6 @@ void proc_opt_fwd(Proc *p, Lexer *l, Node *n) {
assert(n->out.data[0]->in.data[0] == n);
Node *new_ctrl = CTRL(CTRL(CTRL(n)));
Node *out = n->out.data[0];
- //node_remove(p, new_ctrl, CTRL(CTRL(n)));
- // ^ is that needed?
- // idea was to prevent deleting stuff unnecessarily,
- // but i think the new node_set_in() function works
- // completely fine for that original purpose.
node_set_in(p, out, 0, new_ctrl);
proc_opt_fwd(p, l, new_ctrl);
return;