Commit 7b916243 authored by Keith Randall's avatar Keith Randall Committed by Keith Randall

cmd/compile: rename init function from init.ializers back to init

The name change init -> init.ializers was initially required for
initialization code.

With CL 161337 there's no wrapper code any more, there's a data
structure instead (named .inittask). So we can go back to just
plain init appearing in tracebacks.

RELNOTE=yes

Update #29919. Followon to CL 161337.

Change-Id: I5a4a49d286df24b53b2baa193dfda482f3ea82a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/167780
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 27e444d5
...@@ -46,7 +46,7 @@ func fninit(n []*Node) { ...@@ -46,7 +46,7 @@ func fninit(n []*Node) {
// Make a function that contains all the initialization statements. // Make a function that contains all the initialization statements.
if len(nf) > 0 { if len(nf) > 0 {
lineno = nf[0].Pos // prolog/epilog gets line number of first init stmt lineno = nf[0].Pos // prolog/epilog gets line number of first init stmt
initializers := lookup("init.ializers") initializers := lookup("init")
disableExport(initializers) disableExport(initializers)
fn := dclfunc(initializers, nod(OTFUNC, nil, nil)) fn := dclfunc(initializers, nod(OTFUNC, nil, nil))
for _, dcl := range dummyInitFn.Func.Dcl { for _, dcl := range dummyInitFn.Func.Dcl {
......
...@@ -157,7 +157,7 @@ func TestErrorFormatter(t *testing.T) { ...@@ -157,7 +157,7 @@ func TestErrorFormatter(t *testing.T) {
want: "fallback:" + want: "fallback:" +
"\n somefile.go:123" + "\n somefile.go:123" +
"\n - file does not exist:" + "\n - file does not exist:" +
"\n os.init.ializers" + "\n os.init" +
"\n .+/os/error.go:\\d\\d", "\n .+/os/error.go:\\d\\d",
regexp: true, regexp: true,
}, { }, {
......
...@@ -34,8 +34,8 @@ func f() int { ...@@ -34,8 +34,8 @@ func f() int {
if !strings.Contains(s, "a.go:19") { if !strings.Contains(s, "a.go:19") {
panic("missing a.go:19") panic("missing a.go:19")
} }
if !strings.Contains(s, "a.init.ializers") { if !strings.Contains(s, "a.init") {
panic("missing a.init.ializers") panic("missing a.init")
} }
// Check the CallersFrames results. // Check the CallersFrames results.
...@@ -58,11 +58,11 @@ func f() int { ...@@ -58,11 +58,11 @@ func f() int {
panic("traceback truncated after f") panic("traceback truncated after f")
} }
f, more = iter.Next() f, more = iter.Next()
if f.Function != "a.init.ializers" || !strings.HasSuffix(f.File, "a.go") || f.Line != 15 { if f.Function != "a.init" || !strings.HasSuffix(f.File, "a.go") || f.Line != 15 {
panic(fmt.Sprintf("bad init.ializers %v\n", f)) panic(fmt.Sprintf("bad init %v\n", f))
} }
if !more { if !more {
panic("traceback truncated after init.ializers") panic("traceback truncated after init")
} }
f, _ = iter.Next() f, _ = iter.Next()
if !strings.HasPrefix(f.Function, "runtime.") { if !strings.HasPrefix(f.Function, "runtime.") {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment