const forceObjFileStability = true
// Current export format version. Increase with each format change.
-const exportVersion = 1
+const exportVersion = 2
// exportInlined enables the export of inlined function bodies and related
// dependencies. The compiler should work w/o any loss of functionality with
switch op := n.Op; op {
case ODCL:
p.op(ODCL)
- switch n.Left.Class {
- case PPARAM, PPARAMOUT, PAUTO, PAUTOHEAP:
- // TODO(gri) when is this not PAUTO?
- // Also, originally this didn't look like
- // the default case. Investigate.
- fallthrough
- default:
- // TODO(gri) Can we ever reach here?
- p.bool(false)
- p.sym(n.Left)
- }
+ p.sym(n.Left)
p.typ(n.Left.Type)
// case ODCLFIELD:
// read version specific flags - extend as necessary
switch p.version {
- // case 2:
+ // case 3:
// ...
// fallthrough
- case 1:
+ case 2, 1:
p.debugFormat = p.rawStringln(p.rawByte()) == "debug"
p.trackAllTypes = p.bool()
p.posInfoFormat = p.bool()
// --------------------------------------------------------------------
// statements
case ODCL:
- var lhs *Node
- if p.bool() {
- lhs = p.expr()
- } else {
- lhs = dclname(p.sym())
+ if p.version < 2 {
+ // versions 0 and 1 exported a bool here but it
+ // was always false - simply ignore in this case
+ p.bool()
}
- // TODO(gri) avoid list created here!
- return liststmt(variter([]*Node{lhs}, typenod(p.typ()), nil))
+ lhs := dclname(p.sym())
+ typ := typenod(p.typ())
+ return liststmt(variter([]*Node{lhs}, typ, nil)) // TODO(gri) avoid list creation
// case ODCLFIELD:
// unimplemented
package gc
const runtimeimport = "" +
- "version 1\n\n\x00\x00\x01\rruntime\x00\t\x11newobject\x00\x02\x17\"\vt" +
+ "version 2\n\n\x00\x00\x01\rruntime\x00\t\x11newobject\x00\x02\x17\"\vt" +
"yp·2\x00\x00\x01\x17:\x00\t\x13panicindex\x00\x00\x00\t\x13panicslice\x00\x00" +
"\x00\t\x15panicdivide\x00\x00\x00\t\x15throwreturn\x00\x00\x00\t\x11throw" +
"init\x00\x00\x00\t\x11panicwrap\x00\x05 \x00 \x00 \x00\x00\t\rgopanic\x00\x01\x1b\x00" +
"b\x16\x98\x03\x00b\x00\v\xf8\x01\v\x00\x01\x00\n$$\n"
const unsafeimport = "" +
- "version 1\n\n\x00\x00\x01\vunsafe\x00\x05\r\rPointer\x00\x16\x00\t\x0fOff" +
+ "version 2\n\n\x00\x00\x01\vunsafe\x00\x05\r\rPointer\x00\x16\x00\t\x0fOff" +
"setof\x00\x01:\x00\x01\x16\x00\t\vSizeof\x00\x01:\x00\x01\x16\x00\t\rAlignof\x00\x01:\x00" +
"\x01\x16\x00\v\b\v\x00\x01\x00\n$$\n"
// read version specific flags - extend as necessary
switch p.version {
- // case 2:
+ // case 3:
// ...
// fallthrough
- case 1:
+ case 2, 1:
p.debugFormat = p.rawStringln(p.rawByte()) == "debug"
p.trackAllTypes = p.int() != 0
p.posInfoFormat = p.int() != 0