]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: rename init function from init.ializers back to init
authorKeith Randall <khr@google.com>
Mon, 18 Mar 2019 20:17:35 +0000 (13:17 -0700)
committerKeith Randall <khr@golang.org>
Mon, 18 Mar 2019 20:41:12 +0000 (20:41 +0000)
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: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/gc/init.go
src/fmt/errors_test.go
test/fixedbugs/issue29919.dir/a.go

index 01421eee36621dd52f267340f24cd9570485ad5d..6467aafd53ad7efcd0757f6b960dbf541364dc79 100644 (file)
@@ -46,7 +46,7 @@ func fninit(n []*Node) {
        // Make a function that contains all the initialization statements.
        if len(nf) > 0 {
                lineno = nf[0].Pos // prolog/epilog gets line number of first init stmt
-               initializers := lookup("init.ializers")
+               initializers := lookup("init")
                disableExport(initializers)
                fn := dclfunc(initializers, nod(OTFUNC, nil, nil))
                for _, dcl := range dummyInitFn.Func.Dcl {
index ed77709ea015f6ec1e1f9eae3a2cc73fc84a9c51..0183ba77e5b0f16143afcaf1f3cbcc14243f19bc 100644 (file)
@@ -157,7 +157,7 @@ func TestErrorFormatter(t *testing.T) {
                want: "fallback:" +
                        "\n    somefile.go:123" +
                        "\n  - file does not exist:" +
-                       "\n    os.init.ializers" +
+                       "\n    os.init" +
                        "\n        .+/os/error.go:\\d\\d",
                regexp: true,
        }, {
index 2452127ae6221eb606af399cc77782bed40d6924..078f973b4b5c7048bb4fbd9c295c8785ecfd46c5 100644 (file)
@@ -34,8 +34,8 @@ func f() int {
        if !strings.Contains(s, "a.go:19") {
                panic("missing a.go:19")
        }
-       if !strings.Contains(s, "a.init.ializers") {
-               panic("missing a.init.ializers")
+       if !strings.Contains(s, "a.init") {
+               panic("missing a.init")
        }
 
        // Check the CallersFrames results.
@@ -58,11 +58,11 @@ func f() int {
                panic("traceback truncated after f")
        }
        f, more = iter.Next()
-       if f.Function != "a.init.ializers" || !strings.HasSuffix(f.File, "a.go") || f.Line != 15 {
-               panic(fmt.Sprintf("bad init.ializers %v\n", f))
+       if f.Function != "a.init" || !strings.HasSuffix(f.File, "a.go") || f.Line != 15 {
+               panic(fmt.Sprintf("bad init %v\n", f))
        }
        if !more {
-               panic("traceback truncated after init.ializers")
+               panic("traceback truncated after init")
        }
        f, _ = iter.Next()
        if !strings.HasPrefix(f.Function, "runtime.") {