1
0
mirror of https://github.com/golang/go synced 2024-11-19 13:04:45 -07:00

[dev.cc] cmd/9a, cmd/new9a: fix line numbers

Fixed for the other assemblers in CL 2297042 in 2010.

Change-Id: I6cf41c569e884d98d295369e60e550ff8c0884e6
Reviewed-on: https://go-review.googlesource.com/5173
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Russ Cox 2015-02-18 13:32:28 -05:00
parent 09d7db3bbb
commit d0c21af7d3
7 changed files with 1580 additions and 1369 deletions

View File

@ -118,6 +118,7 @@ EXTERN char* outfile;
EXTERN int pass;
EXTERN int32 pc;
EXTERN int peekc;
EXTERN int32 stmtline;
EXTERN int sym;
EXTERN char* symb;
EXTERN int thechar;

View File

@ -64,7 +64,11 @@
%type <addr> imm ximm fimm rel psr lcr cbit fpscr msr mask
%%
prog:
| prog line
| prog
{
stmtline = lineno;
}
line
line:
LNAME ':'

View File

@ -672,7 +672,7 @@ outcode(int a, Addr *g1, int reg, Addr *g2)
p = emallocz(sizeof(Prog));
p->as = a;
p->lineno = lineno;
p->lineno = stmtline;
if(nosched)
p->mark |= NOSCHED;
p->from = *g1;
@ -702,7 +702,7 @@ outgcode(int a, Addr *g1, int reg, Addr *g2, Addr *g3)
p = emallocz(sizeof(Prog));
p->as = a;
p->lineno = lineno;
p->lineno = stmtline;
if(nosched)
p->mark |= NOSCHED;
p->from = *g1;

File diff suppressed because it is too large Load Diff

View File

@ -68,7 +68,11 @@ import (
%type <addr> imm ximm fimm rel psr lcr cbit fpscr msr mask
%%
prog:
| prog line
| prog
{
stmtline = asm.Lineno
}
line
line:
LNAME ':'

View File

@ -40,6 +40,7 @@ import (
var (
yyerror = asm.Yyerror
nullgen obj.Addr
stmtline int32
)
func main() {
@ -496,7 +497,7 @@ func outcode(a int, g1 *obj.Addr, reg int, g2 *obj.Addr) {
p = asm.Ctxt.NewProg()
p.As = int16(a)
p.Lineno = asm.Lineno
p.Lineno = stmtline
if nosched != 0 {
p.Mark |= ppc64.NOSCHED
}
@ -529,7 +530,7 @@ func outgcode(a int, g1 *obj.Addr, reg int, g2, g3 *obj.Addr) {
p = asm.Ctxt.NewProg()
p.As = int16(a)
p.Lineno = asm.Lineno
p.Lineno = stmtline
if nosched != 0 {
p.Mark |= ppc64.NOSCHED
}

File diff suppressed because it is too large Load Diff