mirror of
https://github.com/golang/go
synced 2024-11-22 00:14:42 -07:00
gc: more accurate line numbers for ATEXT
and other begin and end of function code R=ken2 CC=golang-dev https://golang.org/cl/2158044
This commit is contained in:
parent
4427965ee4
commit
1678dcc378
@ -62,6 +62,8 @@ compile(Node *fn)
|
||||
pl = newplist();
|
||||
pl->name = curfn->nname;
|
||||
|
||||
setlineno(curfn);
|
||||
|
||||
nodconst(&nod1, types[TINT32], 0);
|
||||
ptxt = gins(ATEXT, curfn->nname, &nod1);
|
||||
afunclit(&ptxt->from);
|
||||
@ -93,6 +95,8 @@ compile(Node *fn)
|
||||
genlist(curfn->exit);
|
||||
if(nerrors != 0)
|
||||
goto ret;
|
||||
if(curfn->endlineno)
|
||||
lineno = curfn->endlineno;
|
||||
pc->as = ARET; // overwrite AEND
|
||||
pc->lineno = lineno;
|
||||
|
||||
|
@ -62,6 +62,8 @@ compile(Node *fn)
|
||||
pl = newplist();
|
||||
pl->name = curfn->nname;
|
||||
|
||||
setlineno(curfn);
|
||||
|
||||
nodconst(&nod1, types[TINT32], 0);
|
||||
ptxt = gins(ATEXT, curfn->nname, &nod1);
|
||||
afunclit(&ptxt->from);
|
||||
@ -83,6 +85,8 @@ compile(Node *fn)
|
||||
checklabels();
|
||||
if(nerrors != 0)
|
||||
goto ret;
|
||||
if(curfn->endlineno)
|
||||
lineno = curfn->endlineno;
|
||||
|
||||
if(curfn->type->outtuple != 0)
|
||||
ginscall(throwreturn, 0);
|
||||
|
@ -64,6 +64,8 @@ compile(Node *fn)
|
||||
pl = newplist();
|
||||
pl->name = curfn->nname;
|
||||
|
||||
setlineno(curfn);
|
||||
|
||||
nodconst(&nod1, types[TINT32], 0);
|
||||
ptxt = gins(ATEXT, curfn->nname, &nod1);
|
||||
afunclit(&ptxt->from);
|
||||
@ -85,6 +87,8 @@ compile(Node *fn)
|
||||
checklabels();
|
||||
if(nerrors != 0)
|
||||
goto ret;
|
||||
if(curfn->endlineno)
|
||||
lineno = curfn->endlineno;
|
||||
|
||||
if(curfn->type->outtuple != 0)
|
||||
ginscall(throwreturn, 0);
|
||||
|
@ -1100,6 +1100,7 @@ xfndcl:
|
||||
if($$ == N)
|
||||
break;
|
||||
$$->nbody = $3;
|
||||
$$->endlineno = lineno;
|
||||
funcbody($$);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user