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/noder/lex.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/noder/lex.go')
-rw-r--r-- | src/cmd/compile/internal/noder/lex.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/noder/lex.go b/src/cmd/compile/internal/noder/lex.go index 1095f3344a..cdca9e55f3 100644 --- a/src/cmd/compile/internal/noder/lex.go +++ b/src/cmd/compile/internal/noder/lex.go @@ -28,6 +28,7 @@ const ( ir.Nosplit | ir.Noinline | ir.NoCheckPtr | + ir.RegisterParams | // TODO remove after register abi is working ir.CgoUnsafeArgs | ir.UintptrEscapes | ir.Systemstack | @@ -79,6 +80,8 @@ func pragmaFlag(verb string) ir.PragmaFlag { // in the argument list. // Used in syscall/dll_windows.go. return ir.UintptrEscapes + case "go:registerparams": // TODO remove after register abi is working + return ir.RegisterParams case "go:notinheap": return ir.NotInHeap } |