From 12ee55ba7bf22157267e735e8e4bbf651c5b4e7d Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Mon, 11 Jan 2021 15:07:09 -0800 Subject: [dev.regabi] cmd/compile: stop using Vargen for import/export Historically, inline function bodies were exported as plain Go source code, and symbol mangling was a convenient hack because it allowed variables to be re-imported with largely the same names as they were originally exported as. However, nowadays we use a binary format that's more easily extended, so we can simply serialize all of a function's declared objects up front, and then refer to them by index later on. This also allows us to easily report unmangled names all the time (e.g., error message from issue7921.go). Fixes #43633. Change-Id: I46c88f5a47cb921f70ab140976ba9ddce38df216 Reviewed-on: https://go-review.googlesource.com/c/go/+/283193 Run-TryBot: Matthew Dempsky TryBot-Result: Go Bot Reviewed-by: Dan Scales Trust: Dan Scales Trust: Matthew Dempsky --- src/cmd/compile/internal/typecheck/typecheck.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmd/compile/internal/typecheck/typecheck.go') diff --git a/src/cmd/compile/internal/typecheck/typecheck.go b/src/cmd/compile/internal/typecheck/typecheck.go index 3160725e3c..431fb04bef 100644 --- a/src/cmd/compile/internal/typecheck/typecheck.go +++ b/src/cmd/compile/internal/typecheck/typecheck.go @@ -1687,7 +1687,7 @@ func typecheckdeftype(n *ir.Name) { } t := types.NewNamed(n) - t.Vargen = n.Vargen + t.Vargen = n.Typegen if n.Pragma()&ir.NotInHeap != 0 { t.SetNotInHeap(true) } -- cgit v1.2.3-54-g00ecf