mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/gc: disable binary package export format
The new indexed package export format appears stable, and no reports of needing to revert back to binary package export. This CL disables the binary package export format by mechanically replacing 'flagiexport' with 'true', and then superficial code cleanups to keep the resulting code idiomatic. The resulting dead code is removed in a followup CL. Change-Id: Ic30d85f78778a31d279a56b9ab14e80836d50135 Reviewed-on: https://go-review.googlesource.com/c/139337 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
02b444bc1d
commit
d546bebe34
3 changed files with 9 additions and 29 deletions
|
|
@ -249,7 +249,6 @@ func Main(archInit func(*Arch)) {
|
|||
flag.StringVar(&blockprofile, "blockprofile", "", "write block profile to `file`")
|
||||
flag.StringVar(&mutexprofile, "mutexprofile", "", "write mutex profile to `file`")
|
||||
flag.StringVar(&benchfile, "bench", "", "append benchmark times to `file`")
|
||||
flag.BoolVar(&flagiexport, "iexport", true, "export indexed package data")
|
||||
objabi.Flagparse(usage)
|
||||
|
||||
// Record flags that affect the build result. (And don't
|
||||
|
|
@ -1129,24 +1128,13 @@ func importfile(f *Val) *types.Pkg {
|
|||
errorexit()
|
||||
}
|
||||
|
||||
// New indexed format is distinguished by an 'i' byte,
|
||||
// whereas old export format always starts with 'c', 'd', or 'v'.
|
||||
if c == 'i' {
|
||||
if !flagiexport {
|
||||
yyerror("import %s: cannot import package compiled with -iexport=true", file)
|
||||
errorexit()
|
||||
}
|
||||
|
||||
iimport(importpkg, imp)
|
||||
} else {
|
||||
if flagiexport {
|
||||
yyerror("import %s: cannot import package compiled with -iexport=false", file)
|
||||
errorexit()
|
||||
}
|
||||
|
||||
imp.UnreadByte()
|
||||
Import(importpkg, imp.Reader)
|
||||
// Indexed format is distinguished by an 'i' byte,
|
||||
// whereas previous export formats started with 'c', 'd', or 'v'.
|
||||
if c != 'i' {
|
||||
yyerror("import %s: unexpected package format byte: %v", file, c)
|
||||
errorexit()
|
||||
}
|
||||
iimport(importpkg, imp)
|
||||
|
||||
default:
|
||||
yyerror("no import in %q", path_)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue