diff options
author | David Chase <drchase@google.com> | 2021-01-04 13:32:10 -0500 |
---|---|---|
committer | David Chase <drchase@google.com> | 2021-01-13 15:50:04 +0000 |
commit | 861707a8c84f0b1ddbcaea0e9f439398ee2175fb (patch) | |
tree | c4a6e6c249d20865ea801cccc8bedd583aea3a21 /src/cmd/compile/internal/typecheck/iimport.go | |
parent | c1370e918fd88a13f77a133f8e431197cd3a1fc6 (diff) | |
download | go-861707a8c84f0b1ddbcaea0e9f439398ee2175fb.tar.gz go-861707a8c84f0b1ddbcaea0e9f439398ee2175fb.zip |
[dev.regabi] cmd/compile: added limited //go:registerparams pragma for new ABI dev
This only works for functions; if you try it with a method, it will
fail. It does work for both local package and imports. For now,
it tells you when it thinks it sees either a declaration or a call of
such a function (this will normally be silent since no existing
code uses this pragma).
Note: it appears to be really darn hard to figure out if this
pragma was set for a method, and the method's call site. Better
ir.Node wranglers than I might be able to make headway, but it
seemed unnecessary for this experiment.
Change-Id: I601c2ddd124457bf6d62f714d7ac871705743c0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/279521
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/iimport.go')
-rw-r--r-- | src/cmd/compile/internal/typecheck/iimport.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/typecheck/iimport.go b/src/cmd/compile/internal/typecheck/iimport.go index c9effabce0..396d09263a 100644 --- a/src/cmd/compile/internal/typecheck/iimport.go +++ b/src/cmd/compile/internal/typecheck/iimport.go @@ -647,6 +647,9 @@ func (r *importReader) funcExt(n *ir.Name) { r.linkname(n.Sym()) r.symIdx(n.Sym()) + // TODO remove after register abi is working + n.SetPragma(ir.PragmaFlag(r.uint64())) + // Escape analysis. for _, fs := range &types.RecvsParams { for _, f := range fs(n.Type()).FieldSlice() { |