mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: move compiler-specific flags into compiler-spec. export data section
Also: Adjust go/importer accordingly. Change-Id: Ia6669563793e218946af45b9fba1cf986a21c031 Reviewed-on: https://go-review.googlesource.com/21896 Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
be7c786dd0
commit
b1851a3c11
3 changed files with 14 additions and 21 deletions
|
|
@ -62,9 +62,6 @@ func Import(in *bufio.Reader) {
|
|||
Fatalf("importer: imported package not found in pkgList[0]")
|
||||
}
|
||||
|
||||
// read compiler-specific flags
|
||||
importpkg.Safe = p.string() == "safe"
|
||||
|
||||
// defer some type-checking until all types are read in completely
|
||||
// (parser.go:import_package)
|
||||
tcok := typecheckok
|
||||
|
|
@ -73,7 +70,7 @@ func Import(in *bufio.Reader) {
|
|||
|
||||
// read objects
|
||||
|
||||
// Phase 1
|
||||
// phase 1
|
||||
objcount := 0
|
||||
for {
|
||||
tag := p.tagOrIndex()
|
||||
|
|
@ -91,7 +88,10 @@ func Import(in *bufio.Reader) {
|
|||
|
||||
// --- compiler-specific export data ---
|
||||
|
||||
// Phase 2
|
||||
// read compiler-specific flags
|
||||
importpkg.Safe = p.bool()
|
||||
|
||||
// phase 2
|
||||
objcount = 0
|
||||
for {
|
||||
tag := p.tagOrIndex()
|
||||
|
|
@ -264,7 +264,7 @@ func (p *importer) obj(tag int) {
|
|||
}
|
||||
|
||||
default:
|
||||
Fatalf("importer: unexpected object tag")
|
||||
Fatalf("importer: unexpected object (tag = %d)", tag)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue