// (suspected) format errors, and whenever a change is made to the format.
const debugFormat = false // default: false
-// If posInfoFormat is set, position information (file, lineno) is written
-// for each exported object, including methods and struct fields.
-const posInfoFormat = true // default: true
-
// TODO(gri) remove eventually
const forceNewExport = false // force new export format - do NOT submit with this flag set
funcList []*Func
// position encoding
- prevFile string
- prevLine int
+ posInfoFormat bool
+ prevFile string
+ prevLine int
// debugging support
written int // bytes written
strIndex: map[string]int{"": 0}, // empty string is mapped to 0
pkgIndex: make(map[*Pkg]int),
typIndex: make(map[*Type]int),
- trace: trace,
+ // don't emit pos info for builtin packages
+ // (not needed and avoids path name diffs in builtin.go between
+ // Windows and non-Windows machines, exposed via builtin_test.go)
+ posInfoFormat: Debug['A'] == 0,
+ trace: trace,
}
// first byte indicates low-level encoding format
p.rawByte(format)
// posInfo exported or not?
- p.bool(posInfoFormat)
+ p.bool(p.posInfoFormat)
// --- generic export data ---
}
func (p *exporter) pos(n *Node) {
- if !posInfoFormat {
+ if !p.posInfoFormat {
return
}