Commit 1d0664ef authored by Russ Cox's avatar Russ Cox

cmd/9g: use nopout in excise

In addition to duplicating the logic, the old code was
clearing the line number, which led to missing source line
information in the -S output.

Also fix nopout, which was incomplete.

Change-Id: Ic2b596a2f9ec2fe85642ebe125cca8ef38c83085
Reviewed-on: https://go-review.googlesource.com/3512Reviewed-by: 's avatarAustin Clements <austin@google.com>
Reviewed-by: 's avatarDave Cheney <dave@cheney.net>
parent 925861f3
......@@ -236,5 +236,8 @@ void
nopout(Prog *p)
{
p->as = ANOP;
p->from = zprog.from;
p->from3 = zprog.from3;
p->reg = zprog.reg;
p->to = zprog.to;
}
......@@ -327,15 +327,12 @@ ret:
void
excise(Flow *r)
{
Prog *p, *l;
Prog *p;
p = r->prog;
if(debug['P'] && debug['v'])
print("%P ===delete===\n", p);
l = p->link;
*p = zprog;
p->as = ANOP;
p->link = l;
nopout(p);
ostats.ndelmov++;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment