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
|
|
@ -182,22 +182,12 @@ func export(out *bufio.Writer, trace bool) int {
|
|||
Fatalf("exporter: local package path not empty: %q", localpkg.Path)
|
||||
}
|
||||
p.pkg(localpkg)
|
||||
|
||||
// write compiler-specific flags
|
||||
// TODO(gri) move this into the compiler-specific export data section
|
||||
{
|
||||
var flags string
|
||||
if safemode != 0 {
|
||||
flags = "safe"
|
||||
}
|
||||
p.string(flags)
|
||||
}
|
||||
if p.trace {
|
||||
p.tracef("\n")
|
||||
}
|
||||
|
||||
// export objects
|
||||
|
||||
//
|
||||
// First, export all exported (package-level) objects; i.e., all objects
|
||||
// in the current exportlist. These objects represent all information
|
||||
// required to import this package and type-check against it; i.e., this
|
||||
|
|
@ -270,6 +260,12 @@ func export(out *bufio.Writer, trace bool) int {
|
|||
}
|
||||
}
|
||||
|
||||
// write compiler-specific flags
|
||||
p.bool(safemode != 0)
|
||||
if p.trace {
|
||||
p.tracef("\n")
|
||||
}
|
||||
|
||||
// Phase 2: Export objects added to exportlist during phase 1.
|
||||
// Don't use range since exportlist may grow during this phase
|
||||
// and we want to export all remaining objects.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue