aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/typecheck/iimport.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-07-07 04:03:24 -0700
committerMatthew Dempsky <mdempsky@google.com>2021-07-07 18:12:43 +0000
commitc65ca97a452f872516a7e9462cd27ac17d913747 (patch)
tree672b4fcfe20c30ab0cc8bfb661ce60ca3059173f /src/cmd/compile/internal/typecheck/iimport.go
parent501725032cb8e0fd5ef75b50f949dda09ce4b441 (diff)
downloadgo-c65ca97a452f872516a7e9462cd27ac17d913747.tar.gz
go-c65ca97a452f872516a7e9462cd27ac17d913747.zip
[dev.typeparams] cmd/compile: fix windows longtest builder
CL 332469 broke the Windows longtest builders, because it changed the names assigned to autotmp variables that end up in export data. The naming of autotmps doesn't actually matter, so instead we can just hack iexport to write out "$autotmp" as a magic marker, and let the reader replace it with an appropriate unique name. This is a little hacky, but so is iexport's handling of autotmps already, and this should also go away eventually with unified IR. Change-Id: Ic17395337c745b66b9d63ee566299290214e6273 Reviewed-on: https://go-review.googlesource.com/c/go/+/333089 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/iimport.go')
-rw-r--r--src/cmd/compile/internal/typecheck/iimport.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/typecheck/iimport.go b/src/cmd/compile/internal/typecheck/iimport.go
index f178869e28..7b7cd7f148 100644
--- a/src/cmd/compile/internal/typecheck/iimport.go
+++ b/src/cmd/compile/internal/typecheck/iimport.go
@@ -265,6 +265,7 @@ type importReader struct {
// Slice of all dcls for function, including any interior closures
allDcls []*ir.Name
allClosureVars []*ir.Name
+ autotmpgen int
}
func (p *iimporter) newReader(off uint64, pkg *types.Pkg) *importReader {
@@ -516,8 +517,15 @@ func (r *importReader) ident(selector bool) *types.Sym {
return nil
}
pkg := r.currPkg
- if selector && types.IsExported(name) {
- pkg = types.LocalPkg
+ if selector {
+ if types.IsExported(name) {
+ pkg = types.LocalPkg
+ }
+ } else {
+ if name == "$autotmp" {
+ name = autotmpname(r.autotmpgen)
+ r.autotmpgen++
+ }
}
return pkg.Lookup(name)
}