]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: cleanup mkbuiltin.go
authorMatthew Dempsky <mdempsky@google.com>
Tue, 1 Dec 2015 19:52:32 +0000 (11:52 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 18 Feb 2016 21:41:51 +0000 (21:41 +0000)
commit7555f7f2bf1636443b6013c90e45698894af75e1
tree53f001c490cf207046f97075b91dac4f9495b723
parent7d80291c4c8bce8754b6e1aeb962aed1ceef64dc
cmd/compile: cleanup mkbuiltin.go

Changes largely in preparation for eventually switching the builtin
export data to use the new binary format.

Replace fancy incremental line-by-line scanning with simply reading
the entire object file into memory, finding the export data section,
and processing it that way.

Just use "package runtime" and "package unsafe" in the builtin Go
source files so we don't need to rewrite references to "PACKAGE".

Stop looking for init_PACKAGE_function; it doesn't exist anyway.

Compile package runtime with -u so that its export data marks it as a
"safe" package.

Eliminate requirement to pass "runtime" and "unsafe" as command-line
arguments so that just "go run mkbuiltin.go" works.

Only rewrite builtin.go when successful.

Change-Id: I4addfde9e0cfb30607c7a83de686bde0ad1f035a
Reviewed-on: https://go-review.googlesource.com/19624
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/builtin.go
src/cmd/compile/internal/gc/builtin/runtime.go
src/cmd/compile/internal/gc/builtin/unsafe.go
src/cmd/compile/internal/gc/lex.go
src/cmd/compile/internal/gc/mkbuiltin.go
src/cmd/compile/internal/gc/parser.go