"cmd/asm/internal/flags"
"cmd/asm/internal/lex"
"cmd/internal/obj"
+ "cmd/internal/src"
"cmd/internal/sys"
)
prog := &obj.Prog{
Ctxt: p.ctxt,
As: obj.ATEXT,
- Lineno: p.histLineNum,
+ Lineno: src.MakePos(p.histLineNum),
From: nameAddr,
From3: &obj.Addr{
Type: obj.TYPE_CONST,
prog := &obj.Prog{
Ctxt: p.ctxt,
As: obj.APCDATA,
- Lineno: p.histLineNum,
+ Lineno: src.MakePos(p.histLineNum),
From: key,
To: value,
}
prog := &obj.Prog{
Ctxt: p.ctxt,
As: obj.AFUNCDATA,
- Lineno: p.histLineNum,
+ Lineno: src.MakePos(p.histLineNum),
From: valueAddr,
To: nameAddr,
}
var target *obj.Addr
prog := &obj.Prog{
Ctxt: p.ctxt,
- Lineno: p.histLineNum,
+ Lineno: src.MakePos(p.histLineNum),
As: op,
}
switch len(a) {
// fmt.Printf("%s %+v\n", op, a)
prog := &obj.Prog{
Ctxt: p.ctxt,
- Lineno: p.histLineNum,
+ Lineno: src.MakePos(p.histLineNum),
As: op,
}
switch len(a) {
}
p.As = as
- p.Lineno = int32(lineno.Line()) // TODO(gri) fix this
+ p.Lineno = lineno
return p
}
import (
"cmd/internal/obj"
- "cmd/internal/src"
"cmd/internal/sys"
"crypto/md5"
"fmt"
if !n.Name.Needzero {
n.Name.Needzero = true
if debuglive >= 1 {
- Warnl(src.MakePos(p.Lineno), "%v: %L is ambiguously live", Curfn.Func.Nname, n)
+ Warnl(p.Lineno, "%v: %L is ambiguously live", Curfn.Func.Nname, n)
}
}
}
}
n := lv.vars[j]
if n.Class != PPARAM {
- yyerrorl(src.MakePos(p.Lineno), "internal error: %v %L recorded as live on entry, p.Pc=%v", Curfn.Func.Nname, n, p.Pc)
+ yyerrorl(p.Lineno, "internal error: %v %L recorded as live on entry, p.Pc=%v", Curfn.Func.Nname, n, p.Pc)
}
}
}
import (
"bufio"
+ "cmd/internal/src"
"cmd/internal/sys"
"fmt"
)
Forwd *Prog // for x86 back end
Rel *Prog // for x86, arm back ends
Pc int64 // for back ends or assembler: virtual or actual program counter, depending on phase
- Lineno int32 // line number of this instruction
+ Lineno src.Pos // line number of this instruction
Spadj int32 // effect of instruction on stack pointer (increment or decrement amount)
As As // assembler opcode
Reg int16 // 2nd source operand
// Because p->lineno applies to p, phase == 0 (before p)
// takes care of the update.
func pctofileline(ctxt *Link, sym *LSym, oldval int32, p *Prog, phase int32, arg interface{}) int32 {
- if p.As == ATEXT || p.As == ANOP || p.As == AUSEFIELD || p.Lineno == 0 || phase == 1 {
+ if p.As == ATEXT || p.As == ANOP || p.As == AUSEFIELD || p.Lineno.Line() == 0 || phase == 1 {
return oldval
}
- f, l := linkgetline(ctxt, p.Lineno)
+ f, l := linkgetline(ctxt, p.Lineno.Line())
if f == nil {
// print("getline failed for %s %v\n", ctxt->cursym->name, p);
return oldval
}
func (p *Prog) Line() string {
- return p.Ctxt.LineHist.LineString(int(p.Lineno))
+ return p.Ctxt.LineHist.LineString(int(p.Lineno.Line()))
}
var armCondCode = []string{