ctxt := obj.Linknew(architecture.LinkArch)
if *flags.PrintOut {
- ctxt.Debugasm = 1
+ ctxt.Debugasm = true
}
ctxt.Flag_dynlink = *flags.Dynlink
ctxt.Flag_shared = *flags.Shared || *flags.Dynlink
var (
Debug_append int
+ Debug_asm bool
Debug_closure int
debug_dclstack int
Debug_panic int
Debug_slice int
+ Debug_vlog bool
Debug_wb int
Debug_pctab string
)
obj.Flagfn1("I", "add `directory` to import search path", addidir)
obj.Flagcount("K", "debug missing line numbers", &Debug['K'])
obj.Flagcount("N", "disable optimizations", &Debug['N'])
- obj.Flagcount("S", "print assembly listing", &Debug['S'])
+ flag.BoolVar(&Debug_asm, "S", false, "print assembly listing")
obj.Flagfn0("V", "print compiler version", doversion)
obj.Flagcount("W", "debug parse tree after type checking", &Debug['W'])
flag.StringVar(&asmhdr, "asmhdr", "", "write assembly header to `file`")
obj.Flagcount("s", "warn about composite literals that can be simplified", &Debug['s'])
flag.StringVar(&pathPrefix, "trimpath", "", "remove `prefix` from recorded source file paths")
flag.BoolVar(&safemode, "u", false, "reject unsafe code")
- obj.Flagcount("v", "increase debug verbosity", &Debug['v'])
+ flag.BoolVar(&Debug_vlog, "v", false, "increase debug verbosity")
obj.Flagcount("w", "debug type checking", &Debug['w'])
flag.BoolVar(&use_writebarrier, "wb", true, "enable write barrier")
var flag_shared bool
Ctxt.Flag_dynlink = flag_dynlink
Ctxt.Flag_optimize = Debug['N'] == 0
- Ctxt.Debugasm = int32(Debug['S'])
- Ctxt.Debugvlog = int32(Debug['v'])
+ Ctxt.Debugasm = Debug_asm
+ Ctxt.Debugvlog = Debug_vlog
if flag.NArg() < 1 {
usage()
var opc int32
var out [6 + 3]uint32
for {
- if ctxt.Debugvlog != 0 {
+ if ctxt.Debugvlog {
ctxt.Logf("%5.2f span1\n", obj.Cputime())
}
bflag = 0
}
if autosize == 0 && cursym.Text.Mark&LEAF == 0 {
- if ctxt.Debugvlog != 0 {
+ if ctxt.Debugvlog {
ctxt.Logf("save suppressed in: %s\n", cursym.Name)
}
if cursym.Text.From3.Offset&obj.NOSPLIT != 0 {
ctxt.Diag("cannot divide in NOSPLIT function")
}
- if ctxt.Debugdivmod != 0 {
+ if ctxt.Debugdivmod {
break
}
if p.From.Type != obj.TYPE_REG {
* around jmps to fix. this is rare.
*/
for bflag != 0 {
- if ctxt.Debugvlog != 0 {
+ if ctxt.Debugvlog {
ctxt.Logf("%5.2f span1\n", obj.Cputime())
}
bflag = 0
func flushpool(ctxt *obj.Link, p *obj.Prog, skip int) {
if ctxt.Blitrl != nil {
if skip != 0 {
- if ctxt.Debugvlog != 0 && skip == 1 {
+ if ctxt.Debugvlog && skip == 1 {
fmt.Printf("note: flush literal pool at %#x: len=%d ref=%x\n", uint64(p.Pc+4), pool.size, pool.start)
}
q := ctxt.NewProg()
}
p.To.Offset = int64(ctxt.Autosize) - 8
if ctxt.Autosize == 0 && !(cursym.Text.Mark&LEAF != 0) {
- if ctxt.Debugvlog != 0 {
+ if ctxt.Debugvlog {
ctxt.Logf("save suppressed in: %s\n", cursym.Text.From.Sym.Name)
}
cursym.Text.Mark |= LEAF
type Link struct {
Headtype HeadType
Arch *LinkArch
- Debugasm int32
- Debugvlog int32
- Debugdivmod int32
+ Debugasm bool
+ Debugvlog bool
+ Debugdivmod bool
Debugpcln string
Flag_shared bool
Flag_dynlink bool
var otxt int64
var q *obj.Prog
for bflag != 0 {
- if ctxt.Debugvlog != 0 {
+ if ctxt.Debugvlog {
ctxt.Logf("%5.2f span1\n", obj.Cputime())
}
bflag = 0
* expand RET
* expand BECOME pseudo
*/
- if ctxt.Debugvlog != 0 {
+ if ctxt.Debugvlog {
ctxt.Logf("%5.2f noops\n", obj.Cputime())
}
q.Spadj = +autosize
} else if cursym.Text.Mark&LEAF == 0 {
if cursym.Text.From3.Offset&obj.NOSPLIT != 0 {
- if ctxt.Debugvlog != 0 {
+ if ctxt.Debugvlog {
ctxt.Logf("save suppressed in: %s\n", cursym.Name)
}
func (w *objWriter) writeSym(s *LSym) {
ctxt := w.ctxt
- if ctxt.Debugasm != 0 {
+ if ctxt.Debugasm {
w.writeSymDebug(s)
}
}
func Flushplist(ctxt *Link, plist *Plist) {
- flushplist(ctxt, plist, ctxt.Debugasm == 0)
+ flushplist(ctxt, plist, !ctxt.Debugasm)
}
func FlushplistNoFree(ctxt *Link, plist *Plist) {
flushplist(ctxt, plist, false)
var plink *Prog
for p := plist.Firstpc; p != nil; p = plink {
- if ctxt.Debugasm != 0 && ctxt.Debugvlog != 0 {
+ if ctxt.Debugasm && ctxt.Debugvlog {
fmt.Printf("obj: %v\n", p)
}
plink = p.Link
var otxt int64
var q *obj.Prog
for bflag != 0 {
- if ctxt.Debugvlog != 0 {
+ if ctxt.Debugvlog {
ctxt.Logf("%5.2f span1\n", obj.Cputime())
}
bflag = 0
* expand RET
* expand BECOME pseudo
*/
- if ctxt.Debugvlog != 0 {
+ if ctxt.Debugvlog {
ctxt.Logf("%5.2f noops\n", obj.Cputime())
}
* strip NOPs
* expand RET
*/
- if ctxt.Debugvlog != 0 {
+ if ctxt.Debugvlog {
ctxt.Logf("%5.2f noops\n", obj.Cputime())
}