1
0
mirror of https://github.com/golang/go synced 2024-11-19 17:04:41 -07:00
go/src
Matthew Dempsky ce1252a610 cmd/compile: simplify exportsym flags and logic
We used to have three Sym flags for dealing with export/reexport:
Export, Package, and Exported.

Export and Package were used to distinguish whether a symbol is
exported or package-scope (i.e., mutually exclusive), except that for
local declarations Export served double-duty as tracking whether the
symbol had been added to exportlist.

Meanwhile, imported declarations that needed reexporting could be
added to exportlist multiple times, necessitating a flag to track
whether they'd already been written out by exporter.

Simplify all of these into a single OnExportList flag so that we can
ensure symbols on exportlist are present exactly once. Merge
reexportsym into exportsym so there's a single place where we append
to exportlist.

Code that used to set Exported to prevent a symbol from being exported
can now just set OnExportList before calling declare to prevent it
from even appearing on exportlist.

Lastly, drop the IsAlias check in exportsym: we call exportsym too
early for local symbols to detect if they're an alias, and we never
reexport aliases.

Passes toolstash-check.

Change-Id: Icdea3719105dc169fcd7651606589cd08b0a80ff
Reviewed-on: https://go-review.googlesource.com/103865
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-04-02 23:12:53 +00:00
..
archive all: use strings.Builder instead of bytes.Buffer where appropriate 2018-03-26 23:05:53 +00:00
bufio bufio: document ReadFrom/WriteTo calls to underlying methods 2018-03-28 22:21:52 +00:00
builtin
bytes internal/bytealg: move short string Index implementations into bytealg 2018-03-04 19:49:44 +00:00
cmd cmd/compile: simplify exportsym flags and logic 2018-04-02 23:12:53 +00:00
compress compress/gzip: do not count header bytes written in Write 2018-04-02 20:18:14 +00:00
container
context
crypto crypto/md5: add assembly implementation on arm64 2018-04-02 16:14:11 +00:00
database/sql database/sql: check to see if ctx is cancelable before await 2018-03-27 18:40:46 +00:00
debug debug/pe: use bytes.IndexByte instead of a loop 2018-03-07 16:12:08 +00:00
encoding all: remove some unused return parameters 2018-03-24 19:44:47 +00:00
errors
expvar all: use strings.Builder instead of bytes.Buffer where appropriate 2018-03-26 23:05:53 +00:00
flag flag: correct zero values when printing defaults 2018-04-01 20:17:22 +00:00
fmt fmt: document the behaviour of %p on slices 2018-03-30 00:19:36 +00:00
go go/types: fix column reporting of invalid selector names 2018-04-02 21:33:10 +00:00
hash crypto: remove hand encoded amd64 instructions 2018-03-01 19:20:53 +00:00
html html/template: fix one more lint naming error 2018-03-30 23:57:47 +00:00
image all: fix non-standard "DO NOT EDIT" comments for generated files 2018-03-10 17:50:11 +00:00
index/suffixarray
internal internal/cpu: update arm64 cpu features 2018-03-31 07:36:32 +00:00
io io: document that ReadAtLeast and ReadFull can drop errors 2018-03-26 17:38:36 +00:00
log
math math: fix Ldexp when result is below ldexp(2, -1075) 2018-03-29 23:14:13 +00:00
mime all: use strings.Builder instead of bytes.Buffer where appropriate 2018-03-26 23:05:53 +00:00
net Revert "net: mark tests with retry as parallel" 2018-04-01 18:23:34 +00:00
os os: add ModeIrregular flag 2018-03-29 23:17:53 +00:00
path path/filepath: change example to print the correct path on failure 2018-03-26 17:40:01 +00:00
plugin
reflect reflect: sort exported methods first 2018-03-15 21:56:08 +00:00
regexp regexp/syntax: update perl script to preserve \s behavior 2018-03-29 22:31:57 +00:00
runtime go/build, go/types, cmd/dist: add js/wasm architecture 2018-03-30 21:34:18 +00:00
sort sort: fix typo, was a mixup between identifiers 'unsorted' and 'data' 2018-03-19 13:09:29 +00:00
strconv strconv: make code formatting more consistent in doc.go 2018-03-19 12:53:16 +00:00
strings strings: speed-up replace for byteStringReplacer case 2018-04-02 22:34:38 +00:00
sync cmd/internal/obj/arm: add DMB instruction 2018-03-27 19:54:44 +00:00
syscall syscall: remove double Unlock from Dup2 on nacl 2018-03-30 21:37:21 +00:00
testing testing: fix testing flags link 2018-03-30 23:34:47 +00:00
text text/scanner: add examples 2018-03-10 02:01:58 +00:00
time all: remove some unused return parameters 2018-03-24 19:44:47 +00:00
unicode
unsafe unsafe: fix reference to string header 2018-02-26 18:35:46 +00:00
vendor/golang_org/x vendor: update golang.org/x/net/dns/dnsmessage from upstream 2018-03-18 05:48:38 +00:00
all.bash
all.bat
all.rc
androidtest.bash androidtest.bash: don't require GOARCH set 2018-03-07 14:01:43 +00:00
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash iostest.bash: don't build std library twice 2018-03-06 16:08:20 +00:00
make.bash
make.bat build: small cleanup in error message in make.bat 2018-02-26 10:27:14 +00:00
Make.dist
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash src/run.bash: remove some trailing whitespace 2018-04-01 16:12:47 +00:00
run.bat
run.rc