diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2022-07-23 23:54:15 -0700 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2022-07-25 18:32:18 +0000 |
| commit | fc72b7705d67f432fb6a570f84df9e8840eec226 (patch) | |
| tree | 3c3800d1413eb30c6b9e7039a8c9961b8df0ba7a /src/internal | |
| parent | f48fa643f1d8519da42faad1f838d4b2bd035269 (diff) | |
| download | go-fc72b7705d67f432fb6a570f84df9e8840eec226.tar.xz | |
[dev.unified] cmd/compile: add method expressions to dictionaries
This CL changes method expressions that use derived-type receiver
parameters to use dictionary lookups.
Change-Id: Iacd09b6d77a2d3000438ec8bc9b5af2a0b068aa7
Reviewed-on: https://go-review.googlesource.com/c/go/+/419455
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/internal')
| -rw-r--r-- | src/internal/pkgbits/encoder.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/internal/pkgbits/encoder.go b/src/internal/pkgbits/encoder.go index c50c838caa..c0f2252909 100644 --- a/src/internal/pkgbits/encoder.go +++ b/src/internal/pkgbits/encoder.go @@ -316,8 +316,14 @@ func (w *Encoder) Code(c Code) { // section (if not already present), and then writing a relocation // into the element bitstream. func (w *Encoder) String(s string) { + w.StringRef(w.p.StringIdx(s)) +} + +// StringRef writes a reference to the given index, which must be a +// previously encoded string value. +func (w *Encoder) StringRef(idx Index) { w.Sync(SyncString) - w.Reloc(RelocString, w.p.StringIdx(s)) + w.Reloc(RelocString, idx) } // Strings encodes and writes a variable-length slice of strings into |
