When local declarations needed unexported types, these could
be missing in the export data.
Fixes build with -gcflags -lll, except for exp/gotype.
R=golang-dev, rsc, lvd
CC=golang-dev
https://golang.org/cl/
6813067
}
break;
+ case ODCL:
+ // Local variables in the bodies need their type.
+ t = n->left->type;
+ if(t != types[t->etype] && t != idealbool && t != idealstring) {
+ if(isptr[t->etype])
+ t = t->type;
+ if (t && t->sym && t->sym->def && t->sym->pkg != localpkg && t->sym->pkg != builtinpkg) {
+ exportlist = list(exportlist, t->sym->def);
+ }
+ }
+ break;
case OLITERAL:
t = n->type;
--- /dev/null
+package p1
+
+type SockaddrUnix int
+
+func (s SockaddrUnix) Error() string { return "blah" }
--- /dev/null
+package p2
+
+import "./p1"
+
+func SockUnix() error { var s *p1.SockaddrUnix; return s }
--- /dev/null
+package main
+
+import "./p2"
+
+func main() {
+ _ = p2.SockUnix()
+}
--- /dev/null
+// compiledir
+
+// Copyright 2012 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.
+
+// Exported data for inlining could forget types of
+// local variables declared in inlinable bodies.
+
+package ignored