if logopt.Enabled() {
logopt.LogOpt(v.Pos, "nilcheck", "genssa", v.Block.Func.Name)
}
- if gc.Debug_checknil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
+ if gc.Debug.Nil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
gc.Warnl(v.Pos, "generated nil check")
}
case ssa.OpAMD64MOVBatomicload, ssa.OpAMD64MOVLatomicload, ssa.OpAMD64MOVQatomicload:
if logopt.Enabled() {
logopt.LogOpt(v.Pos, "nilcheck", "genssa", v.Block.Func.Name)
}
- if gc.Debug_checknil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
+ if gc.Debug.Nil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
gc.Warnl(v.Pos, "generated nil check")
}
case ssa.OpARMLoweredZero:
if logopt.Enabled() {
logopt.LogOpt(v.Pos, "nilcheck", "genssa", v.Block.Func.Name)
}
- if gc.Debug_checknil != 0 && v.Pos.Line() > 1 { // v.Line==1 in generated wrappers
+ if gc.Debug.Nil != 0 && v.Pos.Line() > 1 { // v.Line==1 in generated wrappers
gc.Warnl(v.Pos, "generated nil check")
}
case ssa.OpARM64Equal,
typecheckslice(fn.Nbody.Slice(), ctxStmt)
Curfn = nil
- if debug_dclstack != 0 {
+ if Debug.DclStack != 0 {
testdclstack()
}
typecheckslice(fn.Nbody.Slice(), ctxStmt)
Curfn = nil
- if debug_dclstack != 0 {
+ if Debug.DclStack != 0 {
testdclstack()
}
// closuredebugruntimecheck applies boilerplate checks for debug flags
// and compiling runtime
func closuredebugruntimecheck(clo *Node) {
- if Debug_closure > 0 {
+ if Debug.Closure > 0 {
if clo.Esc == EscHeap {
Warnl(clo.Pos, "heap closure, captured vars = %v", clo.Func.ClosureVars)
} else {
// If no closure vars, don't bother wrapping.
if hasemptycvars(clo) {
- if Debug_closure > 0 {
+ if Debug.Closure > 0 {
Warnl(clo.Pos, "closure converted to global")
}
return fn.Nname
--- /dev/null
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gc
+
+import (
+ "fmt"
+ "log"
+ "os"
+ "strconv"
+ "strings"
+
+ "cmd/compile/internal/ssa"
+ "cmd/internal/objabi"
+)
+
+// Debug arguments.
+// These can be specified with the -d flag, as in "-d nil"
+// to set the debug_checknil variable.
+// Multiple options can be comma-separated.
+// Each option accepts an optional argument, as in "gcprog=2"
+var debugtab = []struct {
+ name string
+ help string
+ val interface{} // must be *int or *string
+}{
+ {"append", "print information about append compilation", &Debug.Append},
+ {"checkptr", "instrument unsafe pointer conversions", &Debug.Checkptr},
+ {"closure", "print information about closure compilation", &Debug.Closure},
+ {"compilelater", "compile functions as late as possible", &Debug.CompileLater},
+ {"disablenil", "disable nil checks", &Debug.DisableNil},
+ {"dclstack", "run internal dclstack check", &Debug.DclStack},
+ {"dumpptrs", "show Node pointer values in Dump/dumplist output", &Debug.DumpPtrs},
+ {"gcprog", "print dump of GC programs", &Debug.GCProg},
+ {"libfuzzer", "coverage instrumentation for libfuzzer", &Debug.Libfuzzer},
+ {"nil", "print information about nil checks", &Debug.Nil},
+ {"panic", "do not hide any compiler panic", &Debug.Panic},
+ {"slice", "print information about slice compilation", &Debug.Slice},
+ {"typeassert", "print information about type assertion inlining", &Debug.TypeAssert},
+ {"wb", "print information about write barriers", &Debug.WB},
+ {"export", "print export data", &Debug.Export},
+ {"pctab", "print named pc-value table", &Debug.PCTab},
+ {"locationlists", "print information about DWARF location list creation", &Debug.LocationLists},
+ {"typecheckinl", "eager typechecking of inline function bodies", &Debug.TypecheckInl},
+ {"dwarfinl", "print information about DWARF inlined function creation", &Debug.DwarfInl},
+ {"softfloat", "force compiler to emit soft-float code", &Debug.SoftFloat},
+ {"defer", "print information about defer compilation", &Debug.Defer},
+ {"fieldtrack", "enable fieldtracking", &objabi.Fieldtrack_enabled},
+}
+
+var Debug struct {
+ Append int
+ Checkptr int
+ Closure int
+ CompileLater int
+ DisableNil int
+ DclStack int
+ GCProg int
+ Libfuzzer int
+ Nil int
+ Panic int
+ Slice int
+ TypeAssert int
+ WB int
+ Export int
+ PCTab string
+ LocationLists int
+ TypecheckInl int
+ DwarfInl int
+ SoftFloat int
+ Defer int
+ DumpPtrs int
+}
+
+func parseDebug() {
+ // parse -d argument
+ if Flag.LowerD != "" {
+ Split:
+ for _, name := range strings.Split(Flag.LowerD, ",") {
+ if name == "" {
+ continue
+ }
+ // display help about the -d option itself and quit
+ if name == "help" {
+ fmt.Print(debugHelpHeader)
+ maxLen := len("ssa/help")
+ for _, t := range debugtab {
+ if len(t.name) > maxLen {
+ maxLen = len(t.name)
+ }
+ }
+ for _, t := range debugtab {
+ fmt.Printf("\t%-*s\t%s\n", maxLen, t.name, t.help)
+ }
+ // ssa options have their own help
+ fmt.Printf("\t%-*s\t%s\n", maxLen, "ssa/help", "print help about SSA debugging")
+ fmt.Print(debugHelpFooter)
+ os.Exit(0)
+ }
+ val, valstring, haveInt := 1, "", true
+ if i := strings.IndexAny(name, "=:"); i >= 0 {
+ var err error
+ name, valstring = name[:i], name[i+1:]
+ val, err = strconv.Atoi(valstring)
+ if err != nil {
+ val, haveInt = 1, false
+ }
+ }
+ for _, t := range debugtab {
+ if t.name != name {
+ continue
+ }
+ switch vp := t.val.(type) {
+ case nil:
+ // Ignore
+ case *string:
+ *vp = valstring
+ case *int:
+ if !haveInt {
+ log.Fatalf("invalid debug value %v", name)
+ }
+ *vp = val
+ default:
+ panic("bad debugtab type")
+ }
+ continue Split
+ }
+ // special case for ssa for now
+ if strings.HasPrefix(name, "ssa/") {
+ // expect form ssa/phase/flag
+ // e.g. -d=ssa/generic_cse/time
+ // _ in phase name also matches space
+ phase := name[4:]
+ flag := "debug" // default flag is debug
+ if i := strings.Index(phase, "/"); i >= 0 {
+ flag = phase[i+1:]
+ phase = phase[:i]
+ }
+ err := ssa.PhaseOption(phase, flag, val, valstring)
+ if err != "" {
+ log.Fatalf(err)
+ }
+ continue Split
+ }
+ log.Fatalf("unknown debug key -d %s\n", name)
+ }
+ }
+}
+
+const debugHelpHeader = `usage: -d arg[,arg]* and arg is <key>[=<value>]
+
+<key> is one of:
+
+`
+
+const debugHelpFooter = `
+<value> is key-specific.
+
+Key "checkptr" supports values:
+ "0": instrumentation disabled
+ "1": conversions involving unsafe.Pointer are instrumented
+ "2": conversions to unsafe.Pointer force heap allocation
+
+Key "pctab" supports values:
+ "pctospadj", "pctofile", "pctoline", "pctoinline", "pctopcdata"
+`
func assembleInlines(fnsym *obj.LSym, dwVars []*dwarf.Var) dwarf.InlCalls {
var inlcalls dwarf.InlCalls
- if Debug_gendwarfinl != 0 {
+ if Debug.DwarfInl != 0 {
Ctxt.Logf("assembling DWARF inlined routine info for %v\n", fnsym.Name)
}
}
// Debugging
- if Debug_gendwarfinl != 0 {
+ if Debug.DwarfInl != 0 {
dumpInlCalls(inlcalls)
dumpInlVars(dwVars)
}
Ctxt.Diag("failed to locate precursor fn for %v", fn)
return
}
- if Debug_gendwarfinl != 0 {
+ if Debug.DwarfInl != 0 {
Ctxt.Logf("DwarfAbstractFunc(%v)\n", fn.Name)
}
Ctxt.DwarfAbstractFunc(ifn, fn, Ctxt.Pkgpath)
"go/constant"
)
-var (
- Debug_export int // if set, print debugging information about export data
-)
-
func exportf(bout *bio.Writer, format string, args ...interface{}) {
fmt.Fprintf(bout, format, args...)
- if Debug_export != 0 {
+ if Debug.Export != 0 {
fmt.Printf(format, args...)
}
}
size := bout.Offset() - off
exportf(bout, "\n$$\n")
- if Debug_export != 0 {
+ if Debug.Export != 0 {
fmt.Printf("BenchmarkExportSize:%s 1 %d bytes\n", Ctxt.Pkgpath, size)
}
}
"os"
"reflect"
"runtime"
- "strconv"
+
"strings"
- "cmd/compile/internal/ssa"
"cmd/internal/objabi"
"cmd/internal/sys"
)
}
if Flag.Race || Flag.MSan {
// -race and -msan imply -d=checkptr for now.
- Debug_checkptr = 1
+ Debug.Checkptr = 1
}
if Flag.CompilingRuntime && Flag.N != 0 {
log.Fatalf("cannot use concurrent backend compilation with provided flags; invoked as %v", os.Args)
}
- // parse -d argument
- if Flag.LowerD != "" {
- Split:
- for _, name := range strings.Split(Flag.LowerD, ",") {
- if name == "" {
- continue
- }
- // display help about the -d option itself and quit
- if name == "help" {
- fmt.Print(debugHelpHeader)
- maxLen := len("ssa/help")
- for _, t := range debugtab {
- if len(t.name) > maxLen {
- maxLen = len(t.name)
- }
- }
- for _, t := range debugtab {
- fmt.Printf("\t%-*s\t%s\n", maxLen, t.name, t.help)
- }
- // ssa options have their own help
- fmt.Printf("\t%-*s\t%s\n", maxLen, "ssa/help", "print help about SSA debugging")
- fmt.Print(debugHelpFooter)
- os.Exit(0)
- }
- val, valstring, haveInt := 1, "", true
- if i := strings.IndexAny(name, "=:"); i >= 0 {
- var err error
- name, valstring = name[:i], name[i+1:]
- val, err = strconv.Atoi(valstring)
- if err != nil {
- val, haveInt = 1, false
- }
- }
- for _, t := range debugtab {
- if t.name != name {
- continue
- }
- switch vp := t.val.(type) {
- case nil:
- // Ignore
- case *string:
- *vp = valstring
- case *int:
- if !haveInt {
- log.Fatalf("invalid debug value %v", name)
- }
- *vp = val
- default:
- panic("bad debugtab type")
- }
- continue Split
- }
- // special case for ssa for now
- if strings.HasPrefix(name, "ssa/") {
- // expect form ssa/phase/flag
- // e.g. -d=ssa/generic_cse/time
- // _ in phase name also matches space
- phase := name[4:]
- flag := "debug" // default flag is debug
- if i := strings.Index(phase, "/"); i >= 0 {
- flag = phase[i+1:]
- phase = phase[:i]
- }
- err := ssa.PhaseOption(phase, flag, val, valstring)
- if err != "" {
- log.Fatalf(err)
- }
- continue Split
- }
- log.Fatalf("unknown debug key -d %s\n", name)
- }
- }
+ parseDebug()
if Flag.CompilingRuntime {
// Runtime can't use -d=checkptr, at least not yet.
- Debug_checkptr = 0
+ Debug.Checkptr = 0
// Fuzzing the runtime isn't interesting either.
- Debug_libfuzzer = 0
+ Debug.Libfuzzer = 0
}
// set via a -d flag
- Ctxt.Debugpcln = Debug_pctab
+ Ctxt.Debugpcln = Debug.PCTab
}
// registerFlags adds flag registrations for all the fields in Flag.
short := flag&FmtShort != 0
// Useful to see which nodes in an AST printout are actually identical
- if Debug_dumpptrs != 0 {
+ if Debug.DumpPtrs != 0 {
fmt.Fprintf(s, " p(%p)", n)
}
if !short && n.Name != nil && n.Name.Vargen != 0 {
fmt.Fprintf(s, " g(%d)", n.Name.Vargen)
}
- if Debug_dumpptrs != 0 && !short && n.Name != nil && n.Name.Defn != nil {
+ if Debug.DumpPtrs != 0 && !short && n.Name != nil && n.Name.Defn != nil {
// Useful to see where Defn is set and what node it points to
fmt.Fprintf(s, " defn(%p)", n.Name.Defn)
}
var decldepth int32
-var Debug_checknil int
-var Debug_typeassert int
-
var localpkg *types.Pkg // package being compiled
var inimport bool // set during import
var nodfp *Node
-var disable_checknil int
-
var autogeneratedPos src.XPos
// interface to back end
return // typecheckinl on local function
}
- if Flag.LowerM > 2 || Debug_export != 0 {
+ if Flag.LowerM > 2 || Debug.Export != 0 {
fmt.Printf("typecheck import [%v] %L { %#v }\n", fn.Sym, fn, asNodes(fn.Func.Inl.Body))
}
}
// If marked "go:nocheckptr" and -d checkptr compilation, don't inline.
- if Debug_checkptr != 0 && fn.Func.Pragma&NoCheckPtr != 0 {
+ if Debug.Checkptr != 0 && fn.Func.Pragma&NoCheckPtr != 0 {
reason = "marked go:nocheckptr"
return
}
case OCALLMETH:
// Prevent inlining some reflect.Value methods when using checkptr,
// even when package reflect was compiled without it (#35073).
- if s := n.Left.Sym; Debug_checkptr != 0 && isReflectPkg(s.Pkg) && (s.Name == "Value.UnsafeAddr" || s.Name == "Value.Pointer") {
+ if s := n.Left.Sym; Debug.Checkptr != 0 && isReflectPkg(s.Pkg) && (s.Name == "Value.UnsafeAddr" || s.Name == "Value.Pointer") {
return n
}
}
defer func() {
inlMap[fn] = false
}()
- if Debug_typecheckinl == 0 {
+ if Debug.TypecheckInl == 0 {
typecheckinl(fn)
}
"strings"
)
-var (
- Debug_append int
- Debug_checkptr int
- Debug_closure int
- Debug_compilelater int
- debug_dclstack int
- Debug_dumpptrs int
- Debug_libfuzzer int
- Debug_panic int
- Debug_slice int
- Debug_wb int
- Debug_pctab string
- Debug_locationlist int
- Debug_typecheckinl int
- Debug_gendwarfinl int
- Debug_softfloat int
- Debug_defer int
-)
-
-// Debug arguments.
-// These can be specified with the -d flag, as in "-d nil"
-// to set the debug_checknil variable.
-// Multiple options can be comma-separated.
-// Each option accepts an optional argument, as in "gcprog=2"
-var debugtab = []struct {
- name string
- help string
- val interface{} // must be *int or *string
-}{
- {"append", "print information about append compilation", &Debug_append},
- {"checkptr", "instrument unsafe pointer conversions", &Debug_checkptr},
- {"closure", "print information about closure compilation", &Debug_closure},
- {"compilelater", "compile functions as late as possible", &Debug_compilelater},
- {"disablenil", "disable nil checks", &disable_checknil},
- {"dclstack", "run internal dclstack check", &debug_dclstack},
- {"dumpptrs", "show Node pointer values in Dump/dumplist output", &Debug_dumpptrs},
- {"gcprog", "print dump of GC programs", &Debug_gcprog},
- {"libfuzzer", "coverage instrumentation for libfuzzer", &Debug_libfuzzer},
- {"nil", "print information about nil checks", &Debug_checknil},
- {"panic", "do not hide any compiler panic", &Debug_panic},
- {"slice", "print information about slice compilation", &Debug_slice},
- {"typeassert", "print information about type assertion inlining", &Debug_typeassert},
- {"wb", "print information about write barriers", &Debug_wb},
- {"export", "print export data", &Debug_export},
- {"pctab", "print named pc-value table", &Debug_pctab},
- {"locationlists", "print information about DWARF location list creation", &Debug_locationlist},
- {"typecheckinl", "eager typechecking of inline function bodies", &Debug_typecheckinl},
- {"dwarfinl", "print information about DWARF inlined function creation", &Debug_gendwarfinl},
- {"softfloat", "force compiler to emit soft-float code", &Debug_softfloat},
- {"defer", "print information about defer compilation", &Debug_defer},
- {"fieldtrack", "enable fieldtracking", &objabi.Fieldtrack_enabled},
-}
-
-const debugHelpHeader = `usage: -d arg[,arg]* and arg is <key>[=<value>]
-
-<key> is one of:
-
-`
-
-const debugHelpFooter = `
-<value> is key-specific.
-
-Key "checkptr" supports values:
- "0": instrumentation disabled
- "1": conversions involving unsafe.Pointer are instrumented
- "2": conversions to unsafe.Pointer force heap allocation
-
-Key "pctab" supports values:
- "pctospadj", "pctofile", "pctoline", "pctoinline", "pctopcdata"
-`
-
func hidePanic() {
- if Debug_panic == 0 && Errors() > 0 {
+ if Debug.Panic == 0 && Errors() > 0 {
// If we've already complained about things
// in the program, don't bother complaining
// about a panic too; let the user clean up
instrumenting = true
}
if Flag.Dwarf {
- dwarf.EnableLogging(Debug_gendwarfinl != 0)
+ dwarf.EnableLogging(Debug.DwarfInl != 0)
}
- if Debug_softfloat != 0 {
+ if Debug.SoftFloat != 0 {
thearch.SoftFloat = true
}
// Phase 5: Inlining
timings.Start("fe", "inlining")
- if Debug_typecheckinl != 0 {
+ if Debug.TypecheckInl != 0 {
// Typecheck imported function bodies if Debug.l > 1,
// otherwise lazily when used or re-exported.
for _, n := range importlist {
// DWARF inlining gen so as to avoid problems with generated
// method wrappers.
if Ctxt.DwFixups != nil {
- Ctxt.DwFixups.Finalize(Ctxt.Pkgpath, Debug_gendwarfinl != 0)
+ Ctxt.DwFixups.Finalize(Ctxt.Pkgpath, Debug.DwarfInl != 0)
Ctxt.DwFixups = nil
Flag.GenDwarfInl = 0
}
return nil
case 'B':
- if Debug_export != 0 {
+ if Debug.Export != 0 {
fmt.Printf("importing %s (%s)\n", path_, file)
}
imp.ReadByte() // skip \n after $$B
// edge inserts coverage instrumentation for libfuzzer.
func (o *Order) edge() {
- if Debug_libfuzzer == 0 {
+ if Debug.Libfuzzer == 0 {
return
}
// For now just clean all the temporaries at the end.
// In practice that's fine.
case OSWITCH:
- if Debug_libfuzzer != 0 && !hasDefaultCase(n) {
+ if Debug.Libfuzzer != 0 && !hasDefaultCase(n) {
// Add empty "default:" case for instrumentation.
n.List.Append(nod(OCASE, nil, nil))
}
if fn.IsMethod() && isInlinableButNotInlined(fn) {
return false
}
- return Flag.LowerC == 1 && Debug_compilelater == 0
+ return Flag.LowerC == 1 && Debug.CompileLater == 0
}
// isInlinableButNotInlined returns true if 'fn' was marked as an
func FatalfAt(pos src.XPos, format string, args ...interface{}) {
flusherrors()
- if Debug_panic != 0 || numErrors == 0 {
+ if Debug.Panic != 0 || numErrors == 0 {
fmt.Printf("%v: internal compiler error: ", linestr(pos))
fmt.Printf(format, args...)
fmt.Printf("\n")
w gcprog.Writer
}
-var Debug_gcprog int // set by -d gcprog
-
func (p *GCProg) init(lsym *obj.LSym) {
p.lsym = lsym
p.symoff = 4 // first 4 bytes hold program length
p.w.Init(p.writeByte)
- if Debug_gcprog > 0 {
+ if Debug.GCProg > 0 {
fmt.Fprintf(os.Stderr, "compile: start GCProg for %v\n", lsym)
p.w.Debug(os.Stderr)
}
p.w.End()
duint32(p.lsym, 0, uint32(p.symoff-4))
ggloblsym(p.lsym, int32(p.symoff), obj.DUPOK|obj.RODATA|obj.LOCAL)
- if Debug_gcprog > 0 {
+ if Debug.GCProg > 0 {
fmt.Fprintf(os.Stderr, "compile: end GCProg for %v\n", p.lsym)
}
}
case OCLOSURE:
if hasemptycvars(r) {
- if Debug_closure > 0 {
+ if Debug.Closure > 0 {
Warnl(r.Pos, "closure converted to global")
}
// Closures with no captured variables are globals,
}
}
case ODEFER:
- if Debug_defer > 0 {
+ if Debug.Defer > 0 {
var defertype string
if s.hasOpenDefers {
defertype = "open-coded"
// so there will be no write barriers,
// so there's no need to attempt to prevent them.
if s.canSSA(n.Left) {
- if Debug_append > 0 { // replicating old diagnostic message
+ if Debug.Append > 0 { // replicating old diagnostic message
Warnl(n.Pos, "append: len-only update (in local slice)")
}
break
}
- if Debug_append > 0 {
+ if Debug.Append > 0 {
Warnl(n.Pos, "append: len-only update")
}
s.append(rhs, true)
// Used only for automatically inserted nil checks,
// not for user code like 'x != nil'.
func (s *state) nilCheck(ptr *ssa.Value) {
- if disable_checknil != 0 || s.curfn.Func.NilCheckDisabled() {
+ if Debug.DisableNil != 0 || s.curfn.Func.NilCheckDisabled() {
return
}
s.newValue2(ssa.OpNilCheck, types.TypeVoid, ptr, s.mem())
if n.Type.IsEmptyInterface() {
// Converting to an empty interface.
// Input could be an empty or nonempty interface.
- if Debug_typeassert > 0 {
+ if Debug.TypeAssert > 0 {
Warnl(n.Pos, "type assertion inlined")
}
return
}
// converting to a nonempty interface needs a runtime call.
- if Debug_typeassert > 0 {
+ if Debug.TypeAssert > 0 {
Warnl(n.Pos, "type assertion not inlined")
}
if n.Left.Type.IsEmptyInterface() {
return s.rtcall(assertI2I, true, []*types.Type{n.Type}, target, iface)[0], nil
}
- if Debug_typeassert > 0 {
+ if Debug.TypeAssert > 0 {
Warnl(n.Pos, "type assertion inlined")
}
// Converting to a concrete type.
direct := isdirectiface(n.Type)
itab := s.newValue1(ssa.OpITab, byteptr, iface) // type word of interface
- if Debug_typeassert > 0 {
+ if Debug.TypeAssert > 0 {
Warnl(n.Pos, "type assertion inlined")
}
var targetITab *ssa.Value
}
if Ctxt.Flag_locationlists {
- e.curfn.Func.DebugInfo = ssa.BuildFuncDebug(Ctxt, f, Debug_locationlist > 1, stackOffset)
+ e.curfn.Func.DebugInfo = ssa.BuildFuncDebug(Ctxt, f, Debug.LocationLists > 1, stackOffset)
bstart := s.bstart
// Note that at this moment, Prog.Pc is a sequence number; it's
// not a real PC until after assembly, so this mapping has to
}
func (e *ssafn) Debug_checknil() bool {
- return Debug_checknil != 0
+ return Debug.Nil != 0
}
func (e *ssafn) UseWriteBarrier() bool {
}
funcbody()
- if debug_dclstack != 0 {
+ if Debug.DclStack != 0 {
testdclstack()
}
func (f *Func) SetOpenCodedDeferDisallowed(b bool) { f.flags.set(funcOpenCodedDeferDisallowed, b) }
func (f *Func) setWBPos(pos src.XPos) {
- if Debug_wb != 0 {
+ if Debug.WB != 0 {
Warnl(pos, "write barrier")
}
if !f.WBPos.IsKnown() {
n.SetSliceBounds(low, high, max)
if (n.Op == OSLICE || n.Op == OSLICESTR) && low == nil && high == nil {
// Reduce x[:] to x.
- if Debug_slice > 0 {
+ if Debug.Slice > 0 {
Warn("slice: omit slice operation")
}
return n.Left
switch t.Etype {
default:
- if Debug_libfuzzer != 0 && t.IsInteger() {
+ if Debug.Libfuzzer != 0 && t.IsInteger() {
n.Left = cheapexpr(n.Left, init)
n.Right = cheapexpr(n.Right, init)
// function fn at a given level. See debugHelpFooter for defined
// levels.
func checkPtr(fn *Node, level int) bool {
- return Debug_checkptr >= level && fn.Func.Pragma&NoCheckPtr == 0
+ return Debug.Checkptr >= level && fn.Func.Pragma&NoCheckPtr == 0
}
if logopt.Enabled() {
logopt.LogOpt(v.Pos, "nilcheck", "genssa", v.Block.Func.Name)
}
- if gc.Debug_checknil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
+ if gc.Debug.Nil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
gc.Warnl(v.Pos, "generated nil check")
}
case ssa.OpMIPSFPFlagTrue,
if logopt.Enabled() {
logopt.LogOpt(v.Pos, "nilcheck", "genssa", v.Block.Func.Name)
}
- if gc.Debug_checknil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
+ if gc.Debug.Nil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
gc.Warnl(v.Pos, "generated nil check")
}
case ssa.OpMIPS64FPFlagTrue,
if logopt.Enabled() {
logopt.LogOpt(v.Pos, "nilcheck", "genssa", v.Block.Func.Name)
}
- if gc.Debug_checknil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
+ if gc.Debug.Nil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
gc.Warnl(v.Pos, "generated nil check")
}
gc.AddAux(&p.From, v)
p.To.Type = obj.TYPE_REG
p.To.Reg = riscv.REG_ZERO
- if gc.Debug_checknil != 0 && v.Pos.Line() > 1 { // v.Pos == 1 in generated wrappers
+ if gc.Debug.Nil != 0 && v.Pos.Line() > 1 { // v.Pos == 1 in generated wrappers
gc.Warnl(v.Pos, "generated nil check")
}
if logopt.Enabled() {
logopt.LogOpt(v.Pos, "nilcheck", "genssa", v.Block.Func.Name)
}
- if gc.Debug_checknil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
+ if gc.Debug.Nil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
gc.Warnl(v.Pos, "generated nil check")
}
case ssa.OpS390XMVC:
if logopt.Enabled() {
logopt.LogOpt(v.Pos, "nilcheck", "genssa", v.Block.Func.Name)
}
- if gc.Debug_checknil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
+ if gc.Debug.Nil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
gc.Warnl(v.Pos, "generated nil check")
}
if logopt.Enabled() {
logopt.LogOpt(v.Pos, "nilcheck", "genssa", v.Block.Func.Name)
}
- if gc.Debug_checknil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
+ if gc.Debug.Nil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers
gc.Warnl(v.Pos, "generated nil check")
}
case ssa.OpClobber: