Commit graph

45642 commits

Author SHA1 Message Date
Russ Cox 756661c82a [dev.regabi] cmd/compile: finish cleanup of Flag initialization
Now that all flags are in a struct, use struct tags to set the usage messages
and use reflection to walk the struct and register all the flags.

Also move some flag usage back into main.go that shouldn't
come with the rest of flag.go into package base.

Change-Id: Ie655582194906c9ab425c3d01ad8c304bc49bfe0
Reviewed-on: https://go-review.googlesource.com/c/go/+/271668
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-25 16:18:28 +00:00
Matthew Dempsky 259fd8adbb [dev.regabi] cmd/compile: fix reporting of overflow
In the previous CL, I had incorrectly removed one of the error
messages from issue20232.go, because I thought go/constant was just
handling it. But actually the compiler was panicking in nodlit,
because it didn't handle constant.Unknown. So this CL makes it leave
n.Type == nil for unknown constant.Values.

While here, also address #42732 by making sure to report an error
message when origConst is called with an unknown constant.Value (as
can happen when multiplying two floating-point constants overflows).

Finally, add OXOR and OBITNOT to the list of operations to report
errors about, since they're also constant expressions that can produce
a constant with a greater bit length than their operands.

Fixes #42732.

Change-Id: I4a538fbae9b3ac4c553d7de5625dc0c87d9acce3
Reviewed-on: https://go-review.googlesource.com/c/go/+/272928
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2020-11-25 15:47:36 +00:00
Russ Cox 18573aea3c [dev.regabi] cmd/compile: clean up flag handling [generated]
The flag values have grown fairly haphazard, with no organization
or even common naming convention. This CL moves all flag values
into the Flag struct (formerly misnamed Debug), except for a few
that live in Ctxt fields instead.

This CL is entirely automated changes.
A followup CL will make a few manual cleanups, leaving this CL
completely automated and easier to regenerate during merge
conflicts.

Cleaning up flags is necessary because the printing routines
look at some of them, and the printing routines need to move
out of package gc to a new package shared by gc and any
other packages that split out of gc.

[git-generate]

cd src/cmd/compile/internal/gc
rf '
	mv Debug Flag
	mv DebugFlags Flags
	mv Flags.e Flags.LowerE
	mv Flags.h Flags.LowerH
	mv Flags.j Flags.LowerJ
	mv Flags.l Flags.LowerL
	mv Flags.m Flags.LowerM
	mv Flags.r Flags.LowerR
	mv Flags.w Flags.LowerW
	mv Flags.P Flags.Percent
	mv compiling_runtime Flag.CompilingRuntime
	mv compiling_std Flag.Std
	mv localimport Flag.D
	mv asmhdr Flag.AsmHdr
	mv buildid Flag.BuildID
	mv nBackendWorkers Flag.LowerC
	mv pure_go Flag.Complete
	mv debugstr Flag.LowerD
	mv flagDWARF Flag.Dwarf
	mv genDwarfInline Flag.GenDwarfInl
	mv flag_installsuffix Flag.InstallSuffix
	mv flag_lang Flag.Lang
	mv linkobj Flag.LinkObj
	mv debuglive Flag.Live
	mv flag_msan Flag.MSan
	mv nolocalimports Flag.NoLocalImports
	mv outfile Flag.LowerO
	mv myimportpath Ctxt.Pkgpath
	mv writearchive Flag.Pack
	mv flag_race Flag.Race
	mv spectre Flag.Spectre
	mv trace Flag.LowerT
	mv pathPrefix Flag.TrimPath
	mv Debug_vlog Ctxt.Debugvlog
	mv use_writebarrier Flag.WB
	mv Main.flag_shared Flag.Shared
	mv Main.flag_dynlink Flag.Dynlink
	mv Main.goversion Flag.GoVersion
	mv Main.symabisPath Flag.SymABIs
	mv cpuprofile Flag.CPUProfile
	mv memprofile Flag.MemProfile
	mv traceprofile Flag.TraceProfile
	mv blockprofile Flag.BlockProfile
	mv mutexprofile Flag.MutexProfile
	mv benchfile Flag.Bench
	mv Main.smallFrames Flag.SmallFrames
	mv Main.jsonLogOpt Flag.JSON

	add Flag:$ \
		Cfg struct{}
	mv embedCfg Flag.Cfg.Embed
	mv idirs Flag.Cfg.ImportDirs
	mv importMap Flag.Cfg.ImportMap
	mv packageFile Flag.Cfg.PackageFile
	mv spectreIndex Flag.Cfg.SpectreIndex

	mv addidir addImportDir

	mv main.go:/Wasm/-0,/ssaDump/-3 ParseFlags

	mv usage Flag Flags ParseFlags \
		concurrentFlagOk concurrentBackendAllowed \
		addImportDir addImportMap \
		readImportCfg readEmbedCfg \
		flag.go

	# Remove //go:generate line copied from main.go
	# along with two self-assignments from the merge.
	rm flag.go:/go:generate/-+ \
		flag.go:/Ctxt.Pkgpath = Ctxt.Pkgpath/-+ \
		flag.go:/Ctxt.Debugvlog = Ctxt.Debugvlog/-+
'

Change-Id: I10431c15fe7d9f48024d53141d4224d957dbf334
Reviewed-on: https://go-review.googlesource.com/c/go/+/271667
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-25 15:08:55 +00:00
Russ Cox 6e583d65ab [dev.regabi] cmd/compile: simplify fmt handling of Nodes
The existing code introduces many types in what appears to be an
attempt to avoid allocation when converting formatting argument lists.
Simplify by accepting that allocation is going to happen, especially
when Node itself turns into an interface.

Change-Id: I3c0d45ca01eace4924deb43c0ea7dc6d65943d08
Reviewed-on: https://go-review.googlesource.com/c/go/+/272929
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-25 15:08:53 +00:00
Russ Cox d166ef6876 [dev.regabi] cmd/compile: add Node field getters and setters
The goal is to move Node to being an interface and then break
up the one big struct into many implementations.

Step 1 is to convert all current uses of Node to only use methods,
so that the existing algorithms keep working even as the underlying
implementations are adjusted.

Step 0 - this CL - is to add the getters and setters for Step 1.

Change-Id: I0570d8727c3ccb64113627bb9bebcb0dc39da07a
Reviewed-on: https://go-review.googlesource.com/c/go/+/273007
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-25 15:08:52 +00:00
Russ Cox 9262909764 [dev.regabi] cmd/compile: rewrite problematic use of Node fields
For the upcoming rewrite to access methods, a few direct accesses
are problematic for the automated tool, most notably direct copies
or use of Node structs as opposed to pointers.

Fix these manually.

Passes toolstash -cmp.

Change-Id: I8bdbb33216737c09e1edda284d5c414422d86284
Reviewed-on: https://go-review.googlesource.com/c/go/+/273006
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-25 04:35:49 +00:00
Russ Cox 9e0e43d84d [dev.regabi] cmd/compile: remove uses of dummy
Per https://developers.google.com/style/inclusive-documentation,
since we are editing some of this code anyway and it is easier
to put the cleanup in a separate CL.

Change-Id: Ib6b851f43f9cc0a57676564477d4ff22abb1cee5
Reviewed-on: https://go-review.googlesource.com/c/go/+/273106
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-25 04:35:29 +00:00
Matthew Dempsky 4a6b4fd139 [dev.regabi] add FatalfAt and fix Fatalf docs
I've wanted a FatalfAt function for a while, but under the old "-l"
suffix naming convention it would have been called "Fatalfl", which is
just atrocious.

Change-Id: If87f692ecdff478769426d4b054ac396e5c1e42e
Reviewed-on: https://go-review.googlesource.com/c/go/+/273013
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2020-11-25 03:22:35 +00:00
Matthew Dempsky 484449c641 [dev.regabi] cmd/compile: remove file mistakenly added by CL 272248
Change-Id: Ib27a2ab499960cda3bedfd6c1d10a4038c519df5
Reviewed-on: https://go-review.googlesource.com/c/go/+/272986
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2020-11-25 03:17:24 +00:00
Matthew Dempsky 7d72951229 [dev.regabi] cmd/compile: replace Val with go/constant.Value
This replaces the compiler's legacy constant representation with
go/constant, which is used by go/types. This should ease integrating
with the new go/types-based type checker in the future.

Performance difference is mixed, but there's still room for
improvement.

name                      old time/op       new time/op       delta
Template                        280ms ± 6%        281ms ± 6%    ~     (p=0.488 n=592+587)
Unicode                         132ms ±11%        129ms ±11%  -2.61%  (p=0.000 n=592+591)
GoTypes                         865ms ± 3%        866ms ± 3%  +0.16%  (p=0.019 n=572+577)
Compiler                        3.60s ± 3%        3.60s ± 3%    ~     (p=0.083 n=578+582)
SSA                             8.27s ± 2%        8.28s ± 2%  +0.14%  (p=0.002 n=575+580)
Flate                           177ms ± 8%        176ms ± 8%    ~     (p=0.133 n=580+590)
GoParser                        238ms ± 7%        237ms ± 6%    ~     (p=0.569 n=587+591)
Reflect                         542ms ± 4%        543ms ± 4%    ~     (p=0.064 n=581+579)
Tar                             244ms ± 6%        244ms ± 6%    ~     (p=0.880 n=586+584)
XML                             322ms ± 5%        322ms ± 5%    ~     (p=0.449 n=589+590)
LinkCompiler                    454ms ± 6%        453ms ± 6%    ~     (p=0.249 n=585+583)
ExternalLinkCompiler            1.35s ± 4%        1.35s ± 4%    ~     (p=0.968 n=590+588)
LinkWithoutDebugCompiler        279ms ± 7%        280ms ± 7%    ~     (p=0.270 n=589+586)
[Geo mean]                      535ms             534ms       -0.17%

name                      old user-time/op  new user-time/op  delta
Template                        599ms ±22%        602ms ±21%    ~     (p=0.377 n=588+590)
Unicode                         410ms ±43%        376ms ±39%  -8.36%  (p=0.000 n=596+586)
GoTypes                         1.96s ±15%        1.97s ±17%  +0.70%  (p=0.031 n=596+594)
Compiler                        7.47s ± 9%        7.50s ± 8%  +0.38%  (p=0.031 n=591+583)
SSA                             16.2s ± 4%        16.2s ± 5%    ~     (p=0.617 n=531+531)
Flate                           298ms ±25%        292ms ±30%  -2.14%  (p=0.001 n=594+596)
GoParser                        379ms ±20%        381ms ±21%    ~     (p=0.312 n=578+584)
Reflect                         1.24s ±20%        1.25s ±23%  +0.88%  (p=0.031 n=592+596)
Tar                             471ms ±23%        473ms ±21%    ~     (p=0.616 n=593+587)
XML                             674ms ±20%        681ms ±21%  +1.03%  (p=0.050 n=584+587)
LinkCompiler                    842ms ±10%        839ms ±10%    ~     (p=0.074 n=587+590)
ExternalLinkCompiler            1.65s ± 7%        1.65s ± 7%    ~     (p=0.767 n=590+585)
LinkWithoutDebugCompiler        378ms ±11%        379ms ±12%    ~     (p=0.677 n=591+586)
[Geo mean]                      1.02s             1.02s       -0.52%

name                      old alloc/op      new alloc/op      delta
Template                       37.4MB ± 0%       37.4MB ± 0%  +0.06%  (p=0.000 n=589+585)
Unicode                        29.6MB ± 0%       28.6MB ± 0%  -3.11%  (p=0.000 n=574+566)
GoTypes                         120MB ± 0%        120MB ± 0%  -0.01%  (p=0.000 n=594+593)
Compiler                        568MB ± 0%        568MB ± 0%  -0.02%  (p=0.000 n=588+591)
SSA                            1.45GB ± 0%       1.45GB ± 0%  -0.16%  (p=0.000 n=596+592)
Flate                          22.6MB ± 0%       22.5MB ± 0%  -0.36%  (p=0.000 n=593+595)
GoParser                       30.1MB ± 0%       30.1MB ± 0%  -0.01%  (p=0.000 n=590+594)
Reflect                        77.8MB ± 0%       77.8MB ± 0%    ~     (p=0.631 n=584+591)
Tar                            34.1MB ± 0%       34.1MB ± 0%  -0.04%  (p=0.000 n=584+588)
XML                            43.6MB ± 0%       43.6MB ± 0%  +0.07%  (p=0.000 n=593+591)
LinkCompiler                   98.6MB ± 0%       98.6MB ± 0%    ~     (p=0.096 n=590+589)
ExternalLinkCompiler           89.6MB ± 0%       89.6MB ± 0%    ~     (p=0.695 n=590+587)
LinkWithoutDebugCompiler       57.2MB ± 0%       57.2MB ± 0%    ~     (p=0.674 n=590+589)
[Geo mean]                     78.5MB            78.3MB       -0.28%

name                      old allocs/op     new allocs/op     delta
Template                         379k ± 0%         380k ± 0%  +0.33%  (p=0.000 n=593+590)
Unicode                          344k ± 0%         338k ± 0%  -1.67%  (p=0.000 n=594+589)
GoTypes                         1.30M ± 0%        1.31M ± 0%  +0.19%  (p=0.000 n=592+591)
Compiler                        5.40M ± 0%        5.41M ± 0%  +0.23%  (p=0.000 n=587+585)
SSA                             14.2M ± 0%        14.2M ± 0%  +0.08%  (p=0.000 n=594+591)
Flate                            231k ± 0%         230k ± 0%  -0.42%  (p=0.000 n=588+589)
GoParser                         314k ± 0%         315k ± 0%  +0.16%  (p=0.000 n=587+594)
Reflect                          975k ± 0%         976k ± 0%  +0.10%  (p=0.000 n=590+594)
Tar                              344k ± 0%         345k ± 0%  +0.24%  (p=0.000 n=595+590)
XML                              422k ± 0%         424k ± 0%  +0.57%  (p=0.000 n=590+589)
LinkCompiler                     538k ± 0%         538k ± 0%  -0.00%  (p=0.045 n=592+587)
ExternalLinkCompiler             593k ± 0%         593k ± 0%    ~     (p=0.171 n=588+587)
LinkWithoutDebugCompiler         172k ± 0%         172k ± 0%    ~     (p=0.996 n=590+585)
[Geo mean]                       685k              685k       -0.02%

name                      old maxRSS/op     new maxRSS/op     delta
Template                        53.7M ± 8%        53.8M ± 8%    ~     (p=0.666 n=576+574)
Unicode                         54.4M ±12%        55.0M ±10%  +1.15%  (p=0.000 n=591+588)
GoTypes                         95.1M ± 4%        95.1M ± 4%    ~     (p=0.948 n=589+591)
Compiler                         334M ± 6%         334M ± 6%    ~     (p=0.875 n=592+593)
SSA                              792M ± 5%         791M ± 5%    ~     (p=0.067 n=592+591)
Flate                           39.9M ±11%        40.0M ±10%    ~     (p=0.131 n=596+596)
GoParser                        45.2M ±11%        45.3M ±11%    ~     (p=0.353 n=592+590)
Reflect                         76.1M ± 5%        76.2M ± 5%    ~     (p=0.114 n=594+594)
Tar                             49.4M ±10%        49.6M ± 9%  +0.57%  (p=0.015 n=590+593)
XML                             57.4M ± 9%        57.7M ± 8%  +0.67%  (p=0.000 n=592+580)
LinkCompiler                     183M ± 2%         183M ± 2%    ~     (p=0.229 n=587+591)
ExternalLinkCompiler             187M ± 2%         187M ± 3%    ~     (p=0.362 n=571+562)
LinkWithoutDebugCompiler         143M ± 3%         143M ± 3%    ~     (p=0.350 n=584+586)
[Geo mean]                       103M              103M       +0.23%

Passes toolstash-check.

Fixes #4617.

Change-Id: Id4f6759b4afc5e002770091d0d4f6e272ee6cbdd
Reviewed-on: https://go-review.googlesource.com/c/go/+/272654
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
2020-11-25 00:46:44 +00:00
Russ Cox 6826287c6b [dev.regabi] cmd/compile: replace evconst with non-mutating version
evconst is one of the largest sources of Op rewrites,
which prevent separating different kinds of nodes
(in this case, arithmetic nodes and OLITERAL nodes).

The change in swt.go is necessary because otherwise
the syntax graph ends up containing that OLEN expression
multiple times, which violates the invariant that it's a tree
except for ONAME, OLITERAL, and OTYPE nodes.
(Before, the OLEN was overwritten by an OLITERAL, so the
invariant still held, but now that we don't overwrite it,
we need a different copy for each instance.)

Passes toolstash -cmp.

Change-Id: Ia004774ab6852fb384805d0f9f9f234b40842811
Reviewed-on: https://go-review.googlesource.com/c/go/+/272869
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-24 20:58:42 +00:00
Russ Cox c22bc745c3 [dev.regabi] cmd/compile: delete n.List after collapsing OADDSTR to OLITERAL
The leftover n.List is clearly unnecessary, but it makes the
inlining cost of the expression unnecessarily high.

This change breaks toolstash -cmp:

	# cmd/internal/src
	toolstash: compiler output differs, with optimizers disabled (-N)

	inconsistent log line:
	/tmp/go-build866291351/b230/_pkg_.a.log:77:
		/Users/rsc/go/src/cmd/internal/src/pos.go:275:6: can inline (*PosBase).SymFilename with cost 9 as: method(*PosBase) func() string { if b != nil { return b.symFilename }; return "gofile..??" }
	/tmp/go-build866291351/b230/_pkg_.a.stash.log:77:
		/Users/rsc/go/src/cmd/internal/src/pos.go:275:6: can inline (*PosBase).SymFilename with cost 11 as: method(*PosBase) func() string { if b != nil { return b.symFilename }; return "gofile..??" }

Separated from other constant work so that the bigger CL can pass toolstash -cmp.

Change-Id: I5c7ddbc8373207b5b9824eafb8639488da0ca1b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/272868
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-24 20:58:36 +00:00
Russ Cox ee6132a698 [dev.regabi] cmd/compile: introduce OMETHEXPR instead of overloading ONAME
A method expression today is an ONAME that has none of the
invariants or properties of other ONAMEs and is always a special case
(hence the Node.IsMethodExpression method).
Remove the special cases by making a separate Op.

Passes toolstash -cmp.

Change-Id: I7667693c9155d5486a6924dbf75ebb59891c4afc
Reviewed-on: https://go-review.googlesource.com/c/go/+/272867
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-24 20:58:29 +00:00
Russ Cox 4f9d54e41d [dev.regabi] cmd/compile: add OMETHEXPR
This CL is obviously OK but does not pass toolstash -cmp,
because it renumbers the Op codes. In a separate CL so that
we can use toolstash -cmp on the CL with real changes
related to OMETHEXPR.

Change-Id: I1db978e3f2652b3bdf51f7981a3ba5137641c8c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/272866
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-24 20:58:19 +00:00
Russ Cox fd11a32c92 [dev.regabi] cmd/compile: clean up Node.Func
The original meaning of type Func was "extra fields factored out
of a few cases of type Node having to do with functions",
but those specific cases didn't necessarily have any relation.
A typical declared function is represented by an ODCLFUNC Node
at its declaration and an ONAME node at its uses, and both those
have a .Func field, but they are *different* Funcs.
Similarly, a closure is represented both by an OCLOSURE Node for
the value itself and an ODCLFUNC Node for the underlying function
implementing the closure. Those too have *different* Funcs,
and the Func.Closure field in one points to the other and vice versa.
This has led to no end of confusion over the years.

This CL elevates type Func to be the canonical identifier for
a given Go function.

This looks like a trivial CL but in fact is the result of a lot of
scaffolding and rewriting, discarded once the result was achieved, to
separate out the three different kinds of Func nodes into three
separate fields, limited in use to each specific Node type, to
understand which Func fields are used by which Node types and what the
possible overlaps are. There were a few overlaps, most notably around
closures, which led to more fields being added to type Func to keep
them separate even though there is now a single Func instead of two
different ones for each function.

A future CL can and should change Curfn to be a *Func instead of
a *Node, finally eliminating the confusion about whether Curfn
is an ODCLFUNC node (as it is most of the time) or an ONAME node
(as it is when type-checking an inlined function body).

Although sizeof_test.go makes it look like Func is growing by two
words, there are now half as many Funcs in a running compilation,
so the memory footprint has actually been reduced substantially.

Change-Id: I598bd96c95728093dc769a835d48f2154a406a61
Reviewed-on: https://go-review.googlesource.com/c/go/+/272253
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-24 20:58:11 +00:00
Russ Cox 8e2106327c [dev.regabi] cmd/compile: clean up tests to know less about Node
We want to refactor a bit, and these tests know too much about
the layout of Nodes. Use standard constructors instead.

Change-Id: I91f0325c89ea60086655414468c53419ebeacea4
Reviewed-on: https://go-review.googlesource.com/c/go/+/272626
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2020-11-24 20:05:54 +00:00
Matthew Dempsky 742c05e3bc [dev.regabi] cmd/compile: prep refactoring for switching to go/constant
This CL replaces gc.Ctype (along with its CTINT, etc. constants) with
constant.Kind; renames Val.Ctype to Val.Kind; and replaces a handful
of abstraction-violating patterns that can be readily expressed
differently.

The next commit will actually replace Val with constant.Value.

Passes toolstash-check.

[git-generate]
cd src/cmd/compile/internal/gc

sed -i 's/type Ctype uint8/type Ctype = constant.Kind/' const.go
goimports -w const.go

rf '
inline -rm Ctype
mv Val.Ctype Val.Kind

ex import "go/constant"; \
  CTxxx  -> constant.Unknown; \
  CTINT  -> constant.Int; \
  CTFLT  -> constant.Float; \
  CTCPLX -> constant.Complex; \
  CTBOOL -> constant.Bool; \
  CTSTR  -> constant.String

rm CTxxx CTINT CTFLT CTCPLX CTBOOL CTSTR

ex import "cmd/compile/internal/types"; \
  var t *types.Type; \
  var v, v2 Val; \
  v.U.(*Mpint).Cmp(maxintval[TINT]) > 0 -> doesoverflow(v, types.Types[TINT]); \
  v.U.(*Mpint).Cmp(v2.U.(*Mpint)) > 0 -> compareOp(v, OGT, v2); \
  maxintval[t.Etype].Cmp(maxintval[TUINT]) <= 0 -> t.Size() <= types.Types[TUINT].Size(); \
  maxintval[t.Etype].Cmp(maxintval[TUINT]) >  0 -> t.Size() >  types.Types[TUINT].Size();
'

go test cmd/compile -u

Change-Id: I6c22ec0597508845f88eee639a0d76cbaa66d08f
Reviewed-on: https://go-review.googlesource.com/c/go/+/272653
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
2020-11-24 19:50:09 +00:00
Matthew Dempsky 015423a15b [dev.regabi] strconv: add to bootstrap packages
go/constant relies on strconv for parsing Go literals, while older
versions of strconv either lack recent Go language features (e.g., Go
1.13's new numeric literals) or have errors (e.g., mishandling of
carriage returns in raw string literals prior to Go 1.8).

This requires two changes:

1. Splitting out the internal/bytealg dependency into a separate file,
which can be easily substituted with a simple loop for bootstrap
builds.

2. Updating eisel_lemire.go to not utilize Go 1.13 functionality
(underscores in numeric literals and signed shift counts).

Change-Id: Ib48a858a03b155eebdcd08d577aec2254337e70e
Reviewed-on: https://go-review.googlesource.com/c/go/+/272749
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
2020-11-24 19:42:42 +00:00
Matthew Dempsky c767d73227 [dev.regabi] cmd/compile: remove CTRUNE
Since CL 255217, we've been able to rely on types.UntypedRune to
identify untyped rune literals, rather than needing Mpint.Rune /
CTRUNE. This makes way for switching to using go/constant, which
doesn't have a separate notion of rune constants distinct from integer
constants.

Passes toolstash-check.

Change-Id: I319861f4758aeea17345c101b167cb307e706a0e
Reviewed-on: https://go-review.googlesource.com/c/go/+/272652
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
2020-11-24 19:41:59 +00:00
Matthew Dempsky 6dae48fb0b [dev.regabi] cmd/compile: refactor type/value assertions
Small refactoring to make subsequent CLs clearer.

Passes toolstash-check.

Change-Id: I1a6ae599f491220d44aaabae0b7bed4aff46ee92
Reviewed-on: https://go-review.googlesource.com/c/go/+/272651
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
2020-11-24 19:35:46 +00:00
Matthew Dempsky 88a9e2f9ad [dev.regabi] cmd/compile: replace CTNIL with ONIL
Properly speaking, "nil" is a zero value, not a constant. So
go/constant does not have a representation for it. To allow replacing
Val with constant.Value, we split out ONIL separately from OLITERAL so
we can get rid of CTNIL.

Passes toolstash-check.

Change-Id: I4c8e60cae3b3c91bbac43b3b0cf2a4ade028d6cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/272650
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
2020-11-24 19:34:23 +00:00
Matthew Dempsky 4af2decf30 [dev.regabi] cmd/compile: add (unused) ONIL constant
Subsequent CL will make use of ONIL. Split out separately so that the
next CL can pass toolstash-check.

Change-Id: I49d77bedbe2cac4a5da149c925cda969e50b0b2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/272649
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
2020-11-24 19:33:02 +00:00
Matthew Dempsky 668e3a598f [dev.regabi] cmd/compile: cleanup type switch typechecking
Address outstanding TODO, which simplifies subsequent CLs.

Now the compiler always type checks type-switch case clauses (like
gccgo), but it treats clause variables as broken if an appropriate
type cannot be determined for it (like go/types).

Passes toolstash-check.

Change-Id: Iedfe9cdf38c6865211e4b93391f1cf72c1bed136
Reviewed-on: https://go-review.googlesource.com/c/go/+/272648
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
2020-11-24 19:32:42 +00:00
Matthew Dempsky 96f3fb7244 [dev.regabi] go/constant: avoid heap allocations in match
When type switching from interface{} to T, and then returning the T as
interface{} again, it's better to return the original interface{}
value. This avoids needing to heap allocate the T for
non-pointer-shaped types (i.e., int64Val, complexVal, stringVal).

Change-Id: I25c83b3f9ec9bd2ffeec5a65279b68f4fcef8a19
Reviewed-on: https://go-review.googlesource.com/c/go/+/272647
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2020-11-24 19:17:49 +00:00
Matthew Dempsky 1abb12fc97 [dev.regabi] go/constant: optimize BitLen
Avoids an unnecessary heap allocation when computing the bit length of
int64 values.

Change-Id: I69dfc510e461daf3e83b0b7b6c0707f6526a32d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/272646
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2020-11-24 19:17:41 +00:00
Russ Cox 228b732ad9 [dev.regabi] cmd/compile: prepare for package ir
The next CL will introduce a package ir to hold the IR definitions.
This CL adjusts a few names and makes a few other minor changes
to make the next CL - an automated one - smoother.

Change-Id: Ie787a34732efd5b3d171bf0c1220b6dd91994ce3
Reviewed-on: https://go-review.googlesource.com/c/go/+/272251
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-24 15:07:48 +00:00
Russ Cox e37597f7f0 [dev.regabi] cmd/compile: rename a few 'base' identifiers
We want to introduce a package cmd/compile/internal/base,
and these will shadow it at points where it is needed.

Change-Id: Ic936733fba1ccba8c2ca1fdedbd4d2989df4bbf4
Reviewed-on: https://go-review.googlesource.com/c/go/+/272249
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-24 15:07:30 +00:00
Russ Cox 357c576878 [dev.regabi] cmd/compile: clean up error API
Prepare for factoring the error API out of this package by
cleaning it up. The doc comments use the intended new names,
which will be introduced in the next CL.

Change-Id: Ie4c8d4262422da32a9a9f750fda42c225b6b42a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/272248
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-24 15:07:09 +00:00
Russ Cox 5fd949e4bd [dev.regabi] cmd/compile: initialize importMap lazily
This sets up the next CL, moving importMap to a global zeroed struct.

Change-Id: I1acc91b440d3da6e28fb32bd275fb3cd36db4e97
Reviewed-on: https://go-review.googlesource.com/c/go/+/272046
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-24 14:58:20 +00:00
Russ Cox 7b144ed4f7 [dev.regabi] cmd/compile: rewrite concurrentFlagOk to be clearer
The current implementation copies Debug, clears a bunch of flags
that are meant to be considered OK, and then checks the result
against the zero value. But more flags are cleared than remain:
it's easier to write and to understand to just check the ones that
need checking.

This phrasing also makes it safe to move more flags into the struct.

It turns out that some of the flags being checked should probably
not be checked, but this CL is meant to be a strict semantic no-op,
so left a TODO to clean up the function a bit more later.

Change-Id: I7afe6d7b32b5b889c40dd339568e8602e02df9bc
Reviewed-on: https://go-review.googlesource.com/c/go/+/271666
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-24 14:58:10 +00:00
Matthew Dempsky c754f25241 [dev.regabi] cmd/compile/internal/types: remove Func.Nname
Now that there's no code remaining that uses Func.Nname, we can get
rid of it along with the remaining code that uselessly assigns to it.

Passes toolstash-check.

Change-Id: I104ab3bb5122fb824c741bc6e4d9d54fefe5646e
Reviewed-on: https://go-review.googlesource.com/c/go/+/272390
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2020-11-24 01:34:39 +00:00
Matthew Dempsky c50c7a8c06 [dev.regabi] cmd/compile/internal/gc: refactor to use stop using Func.Nname
Automated factoring produced by rf script below to replace uses of
Func.Nname with Field.Nname or Node.MethodName as appropriate.

Some dead assignments to Func.Nname are left behind; these will be
removed in a subequent remove-only CL.

Passes toolstash-check.

[git-generate]
cd src/cmd/compile/internal/gc
rf '
ex \
  import "cmd/compile/internal/types"; \
  var f *types.Field; \
  var n *types.Node; \
  f.Type.Nname() -> f.Nname; \
  f.Type.SetNname(n) -> f.Nname = n; \
  f.Type.FuncType().Nname -> f.Nname

ex \
  var n *Node; \
  asNode(n.Type.Nname()) -> n.MethodName(); \
  asNode(n.Type.FuncType().Nname) -> n.MethodName(); \
  asNode(callpartMethod(n).Type.Nname()) -> n.MethodName()
'

Change-Id: Iaae054324dfe7da6f5d8b8d57a1e05b58cc5968c
Reviewed-on: https://go-review.googlesource.com/c/go/+/272389
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2020-11-24 01:34:32 +00:00
Matthew Dempsky d5928847de [dev.regabi] cmd/compile/internal/gc: prep for Func.Nname removal refactoring
There are three bits of method-handling code where we separately go
from Field->Type and then Type->Node. By shuffling the code around a
little to go Field->Type->Node in a single statement, we're able to
more easily remove Type from the operation.

Passes toolstash-check.

Change-Id: Ife98216d70d3b867fa153449abef0e56a4fb242a
Reviewed-on: https://go-review.googlesource.com/c/go/+/272388
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2020-11-24 01:34:20 +00:00
Matthew Dempsky b30c7a8044 [dev.regabi] cmd/compile/internal/gc: add MethodName for getting referenced method
A common operation throughout the front end is getting the ONAME for a
method used in a method selector, method expression, or method value.
This CL adds MethodName as a uniform API for doing this for all of
these kinds of nodes.

For method selectors (ODOTMETH) and method expressions (ONAMEs where
isMethodExpression reports true), we take advantage of the Node.Opt
field to save the types.Field. This is the approach we already started
taking in golang.org/cl/271217 (caching types.Field in Node.Opt for
ODOT).

For method values (OCALLPART), we continue using the existing
callpartMethod helper function. Escape analysis already uses Node.Opt
for tracking the method value's closure's data flow.

A subsequent, automated refactoring CL will make more use of this
method. For now, we just address a few cases in inl.go that aren't
easily automated.

Passes toolstash-check.

Change-Id: Ic92b288b2d8b2fa7e18e3b68634326b8ef0d869b
Reviewed-on: https://go-review.googlesource.com/c/go/+/272387
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2020-11-24 01:34:13 +00:00
Matthew Dempsky e1047302bd [dev.regabi] cmd/compile/internal/types: add pos/sym/typ params to NewField
These are almost always set, so might as well expect callers to
provide them. They're also all required by go/types's corresponding
New{Field,Func,Param,Var} functions, so this eases API compatibility.

Passes toolstash-check.

Change-Id: Ib3fa355d4961243cd285b41915e87652ae2c22f6
Reviewed-on: https://go-review.googlesource.com/c/go/+/272386
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2020-11-24 01:33:25 +00:00
Robert Griesemer 762eda346a go/types: fix incorrect string(int) conversion (regression)
The bug was introduced by https://golang.org/cl/220844.

Fixes #42790.

Change-Id: I44d619a1a4d3f2aee1c5575d5cfddcc4ba10895f
Reviewed-on: https://go-review.googlesource.com/c/go/+/272666
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2020-11-24 00:50:11 +00:00
Michael Anthony Knyszek 48a1a51898 runtime/metrics: tweak wording of stack and unused memory metrics
This change tweaks and simplifies the descriptions of a couple metrics
to make them easier to parse (for humans).

Change-Id: I852654c7e7042c662ebdfa6334e3baf49ca4b33c
Reviewed-on: https://go-review.googlesource.com/c/go/+/272566
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2020-11-23 19:58:25 +00:00
Martin Möhrmann d902791b50 sync: use 386 instead of x86-32 to refer to the 32 bit x86 architecture
This aligns the naming with GOARCH using 386 as a build target for
this architecture and makes it more easily found when searching
for documentation related to the build target.

Change-Id: I393bb89dd2f71e568124107b13e1b288fbd0c76a
Reviewed-on: https://go-review.googlesource.com/c/go/+/271988
Trust: Martin Möhrmann <moehrmann@google.com>
Run-TryBot: Martin Möhrmann <martisch@uos.de>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-11-23 05:57:35 +00:00
Keith Randall 9ea6364a5e cmd/compile: add test for 42753
This issue was already fixed at tip. Just adding the test that
failed on 1.14/1.15.

Update #42753

Change-Id: I00d13ade476b9c17190d762d7fdcb30cf6c83954
Reviewed-on: https://go-review.googlesource.com/c/go/+/272029
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2020-11-21 16:46:05 +00:00
Jason A. Donenfeld f7342596da syscall: add DLLError.Unwrap function
Because we're expecting for future functions to be unavailable, we
should add an Unwrap() function to the DLLError struct, so that people
can test for this situation easily via:

    if errors.Is(err, syscall.ERROR_PROC_NOT_FOUND) { ... }

DLLError already was wrapping the underlying Errno error, but never got
the Go 1.13 helper method.

Fixes golang/go#42584

Change-Id: I0f32a5146946b1b37a30897ba825a56faefc792c
Reviewed-on: https://go-review.googlesource.com/c/go/+/269761
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
2020-11-21 07:37:02 +00:00
Bryan C. Mills f93ef07b11 cmd/go/internal/modload: remove the Reqs function
The Reqs function returns an mvs.Reqs implemention for the global
build list. The API that it presents assumes that the build list is
globally consistent (problematic for #40775) and readily available
(problematic for #36460).

Fortunately, it is no longer used outside of the modload package.
We can instead use individual instances of the unexported mvsReqs
struct, making the dependency on the global build list more explicit.

For #36460
For #40775

Change-Id: I8674442f2a86416b0bf9c3395cb591c1e724c9d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/272129
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-11-21 03:29:37 +00:00
Bryan C. Mills 3f5a97514b cmd/go/internal/modload: remove a stale comment for EditBuildList
For #36460
Updates #37438

Change-Id: I1626d40e78b110035a893b1b80dbd2279bf50ffe
Reviewed-on: https://go-review.googlesource.com/c/go/+/272128
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-11-21 03:28:08 +00:00
Michael Matloob 78e59bb1f7 cmd/go: support the -overlay flag for go mod commands
Move the declaration of the -overlay flag to base.AddModCommonFlags,
where other flags that are needed for go mod commands and for builds
are declared. The flag's already initialized in modload.Init so
there's no additional work needed to be done to support it in the go
mod commands.

For #39958

Change-Id: I70725d620cc69cb820f6ed923d626f4fe041b1c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/272126
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-11-20 23:58:48 +00:00
Ian Lance Taylor c47eac7db0 cmd/cgo, cmd/internal/pkgpath: support gofrontend mangler v3
The gofrontend mangling scheme used by gccgo and GoLLVM has changed again.
Support the new version. This is a port of the relevant parts of
https://golang.org/cl/271726.

For #41862

Change-Id: I9c961c8e17ec960a83a23e1d49ea900962b63393
Reviewed-on: https://go-review.googlesource.com/c/go/+/272127
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2020-11-20 21:45:57 +00:00
Hollow Man 3fd4917472 doc: fix misspelling of “initialization” in diagnostics.html
initilization -> initialization

Change-Id: Ie5edd30559941f2d044280d8d586c2c2692d5b69
GitHub-Last-Rev: 7495a8c722
GitHub-Pull-Request: golang/go#42749
Reviewed-on: https://go-review.googlesource.com/c/go/+/272026
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Trust: Ian Lance Taylor <iant@golang.org>
2020-11-20 20:02:47 +00:00
Michael Matloob 676f0a45ed cmd/go: support overlaying go.mod files
This change updates the lockedfile package to open files using the
new fsys.OpenFile function. The logic of fsys.Open has been moved into
fsys.OpenFile, and fsys.Open is now just a light wrapper around it.

For #39958

Change-Id: I552f1a45ac00ac06b5812008d17a61e610b4b113
Reviewed-on: https://go-review.googlesource.com/c/go/+/266797
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-11-20 18:29:46 +00:00
Jay Conrod a19c925eda cmd/go: recommend 'go get' command to switch from retracted versions
This CL restores a message unintentionally removed in CL 270858.

For #24031

Change-Id: I957c5c59e624df98e72dfff351298bfc5bf9a9e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/272066
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2020-11-20 17:35:55 +00:00
Cuong Manh Le c306fd6d0b cmd/compile: allow loading single field of typed-interface{} OpIData
Same reason as CL 270057, but for OpLoad.

Fixes #42727

Change-Id: Iebb1a8110f29427a0aed3b5e3e84f0540de3d1b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/271906
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2020-11-20 17:31:50 +00:00
Jay Conrod 5e58ae43be cmd/go: report changes and resolved versions in 'go get'
Fixes #33284

Change-Id: I33daa5eb518985bc7308f29655e04c57e244b479
Reviewed-on: https://go-review.googlesource.com/c/go/+/269018
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-11-20 16:42:46 +00:00
Jay Conrod 012efc67f2 cmd/go/internal/modload: ignore selected version in checkRetractions
Fixes #42601

Change-Id: I58d817ed34ccbd39591326c4bc23569f94028412
Reviewed-on: https://go-review.googlesource.com/c/go/+/272006
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
2020-11-20 16:23:19 +00:00