mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: make Class a Stringer
Change-Id: I7fd137d01ab5a0690773ca6e47d2bd796f0e393e Reviewed-on: https://go-review.googlesource.com/42177 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
a8e3852a05
commit
5e157db37a
2 changed files with 17 additions and 0 deletions
16
src/cmd/compile/internal/gc/class_string.go
Normal file
16
src/cmd/compile/internal/gc/class_string.go
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Code generated by "stringer -type=Class"; DO NOT EDIT.
|
||||||
|
|
||||||
|
package gc
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
const _Class_name = "PxxxPEXTERNPAUTOPAUTOHEAPPPARAMPPARAMOUTPFUNCPDISCARD"
|
||||||
|
|
||||||
|
var _Class_index = [...]uint8{0, 4, 11, 16, 25, 31, 40, 45, 53}
|
||||||
|
|
||||||
|
func (i Class) String() string {
|
||||||
|
if i >= Class(len(_Class_index)-1) {
|
||||||
|
return fmt.Sprintf("Class(%d)", i)
|
||||||
|
}
|
||||||
|
return _Class_name[_Class_index[i]:_Class_index[i+1]]
|
||||||
|
}
|
||||||
|
|
@ -31,6 +31,7 @@ func isRuntimePkg(p *types.Pkg) bool {
|
||||||
// called declaration contexts.
|
// called declaration contexts.
|
||||||
type Class uint8
|
type Class uint8
|
||||||
|
|
||||||
|
//go:generate stringer -type=Class
|
||||||
const (
|
const (
|
||||||
Pxxx Class = iota // no class; used during ssa conversion to indicate pseudo-variables
|
Pxxx Class = iota // no class; used during ssa conversion to indicate pseudo-variables
|
||||||
PEXTERN // global variable
|
PEXTERN // global variable
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue