]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: added limited //go:registerparams pragma for new ABI dev
authorDavid Chase <drchase@google.com>
Mon, 4 Jan 2021 18:32:10 +0000 (13:32 -0500)
committerDavid Chase <drchase@google.com>
Wed, 13 Jan 2021 15:50:04 +0000 (15:50 +0000)
commit861707a8c84f0b1ddbcaea0e9f439398ee2175fb
treec4a6e6c249d20865ea801cccc8bedd583aea3a21
parentc1370e918fd88a13f77a133f8e431197cd3a1fc6
[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>
src/cmd/compile/internal/ir/node.go
src/cmd/compile/internal/noder/lex.go
src/cmd/compile/internal/ssagen/ssa.go
src/cmd/compile/internal/typecheck/iexport.go
src/cmd/compile/internal/typecheck/iimport.go
test/abi/regabipragma.dir/main.go [new file with mode: 0644]
test/abi/regabipragma.dir/tmp/foo.go [new file with mode: 0644]
test/abi/regabipragma.go [new file with mode: 0644]
test/abi/regabipragma.out [new file with mode: 0644]
test/run.go