]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.regabi] cmd/compile: cleanup //go:generate directives
authorMatthew Dempsky <mdempsky@google.com>
Mon, 28 Dec 2020 23:40:19 +0000 (15:40 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 29 Dec 2020 02:28:24 +0000 (02:28 +0000)
During recent refactoring, we moved mkbuiltin.go to package typecheck,
but accidentally duplicated its //go:generate directive into a bunch
of other files/directories. This CL cleans up the unnecessary
duplicates.

Also, update all of the stringer invocations to use an explicit file
name, and regenerate their files.

Updates #43369.

Change-Id: I4e493c1fff103d742de0a839d7a3375659270b50
Reviewed-on: https://go-review.googlesource.com/c/go/+/280635
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Meng Zhuo <mzh@golangcn.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Meng Zhuo <mzh@golangcn.org>
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/ir/class_string.go
src/cmd/compile/internal/ir/name.go
src/cmd/compile/internal/ir/node.go
src/cmd/compile/internal/ir/op_string.go
src/cmd/compile/internal/noder/import.go
src/cmd/compile/internal/ssagen/abi.go
src/cmd/compile/internal/syntax/operator_string.go
src/cmd/compile/internal/syntax/token_string.go
src/cmd/compile/internal/syntax/tokens.go

index ba3620e6769fdadd1ad63a9894b0c40a96d0918e..ced82736ce4829ee28ab0d66d9970f1de2cd9f5e 100644 (file)
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:generate go run mkbuiltin.go
-
 package gc
 
 import (
index 866bf1a6b5b78ed86b810c648dc342d5e388e287..13b9bd4812cce0e644924d3afae08c452cb1a3f9 100644 (file)
@@ -1,4 +1,4 @@
-// Code generated by "stringer -type=Class"; DO NOT EDIT.
+// Code generated by "stringer -type=Class name.go"; DO NOT EDIT.
 
 package ir
 
index cc8e1b4cd19005c9bcadf6e890d8bdd01bdad3a7..cb4876b9f8537364c950f9031a5ea96b9a881821 100644 (file)
@@ -373,7 +373,7 @@ func DeclaredBy(x, stmt Node) bool {
 // called declaration contexts.
 type Class uint8
 
-//go:generate stringer -type=Class
+//go:generate stringer -type=Class name.go
 const (
        Pxxx      Class = iota // no class; used during ssa conversion to indicate pseudo-variables
        PEXTERN                // global variables
index b4a557f290d7904109abb9ba9005a012d93acfc8..54a3e2ba89bb1af34c09a6067b5b78deb2522c13 100644 (file)
@@ -92,7 +92,7 @@ func MayBeShared(n Node) bool {
        return false
 }
 
-//go:generate stringer -type=Op -trimprefix=O
+//go:generate stringer -type=Op -trimprefix=O node.go
 
 type Op uint8
 
index f23e08c47cbf2f9c243063f3b925aef7d452cd7e..0339444132e44b20b76110faca7751960eba3602 100644 (file)
@@ -1,4 +1,4 @@
-// Code generated by "stringer -type=Op -trimprefix=O"; DO NOT EDIT.
+// Code generated by "stringer -type=Op -trimprefix=O node.go"; DO NOT EDIT.
 
 package ir
 
index a39be9864b41410c6c0af40dc29e5a8fe6f01f90..08f19a4028466fb5c5117b38eff4cd976d35a6c2 100644 (file)
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:generate go run mkbuiltin.go
-
 package noder
 
 import (
index af08fcb7c3b7236b412f43ae13a39d4f35ad9fc1..b0338e8155db957d811edb9a4451ab98f38ebe70 100644 (file)
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:generate go run mkbuiltin.go
-
 package ssagen
 
 import (
index 3c759b2e9befb74399a2bfdfdabd3457ac087c15..a7cd40fb13518658f8bad10c749c497fa131d63f 100644 (file)
@@ -1,9 +1,37 @@
-// Code generated by "stringer -type Operator -linecomment"; DO NOT EDIT.
+// Code generated by "stringer -type Operator -linecomment tokens.go"; DO NOT EDIT.
 
 package syntax
 
 import "strconv"
 
+func _() {
+       // An "invalid array index" compiler error signifies that the constant values have changed.
+       // Re-run the stringer command to generate them again.
+       var x [1]struct{}
+       _ = x[Def-1]
+       _ = x[Not-2]
+       _ = x[Recv-3]
+       _ = x[OrOr-4]
+       _ = x[AndAnd-5]
+       _ = x[Eql-6]
+       _ = x[Neq-7]
+       _ = x[Lss-8]
+       _ = x[Leq-9]
+       _ = x[Gtr-10]
+       _ = x[Geq-11]
+       _ = x[Add-12]
+       _ = x[Sub-13]
+       _ = x[Or-14]
+       _ = x[Xor-15]
+       _ = x[Mul-16]
+       _ = x[Div-17]
+       _ = x[Rem-18]
+       _ = x[And-19]
+       _ = x[AndNot-20]
+       _ = x[Shl-21]
+       _ = x[Shr-22]
+}
+
 const _Operator_name = ":!<-||&&==!=<<=>>=+-|^*/%&&^<<>>"
 
 var _Operator_index = [...]uint8{0, 1, 2, 4, 6, 8, 10, 12, 13, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 30, 32}
index 3cf5473febfd0d495763549ee6a9e7d7f12e53c9..ef295eb24b2bc9acb4b0d44ca9893f3bcb5067c2 100644 (file)
@@ -1,9 +1,62 @@
-// Code generated by "stringer -type token -linecomment"; DO NOT EDIT.
+// Code generated by "stringer -type token -linecomment tokens.go"; DO NOT EDIT.
 
 package syntax
 
 import "strconv"
 
+func _() {
+       // An "invalid array index" compiler error signifies that the constant values have changed.
+       // Re-run the stringer command to generate them again.
+       var x [1]struct{}
+       _ = x[_EOF-1]
+       _ = x[_Name-2]
+       _ = x[_Literal-3]
+       _ = x[_Operator-4]
+       _ = x[_AssignOp-5]
+       _ = x[_IncOp-6]
+       _ = x[_Assign-7]
+       _ = x[_Define-8]
+       _ = x[_Arrow-9]
+       _ = x[_Star-10]
+       _ = x[_Lparen-11]
+       _ = x[_Lbrack-12]
+       _ = x[_Lbrace-13]
+       _ = x[_Rparen-14]
+       _ = x[_Rbrack-15]
+       _ = x[_Rbrace-16]
+       _ = x[_Comma-17]
+       _ = x[_Semi-18]
+       _ = x[_Colon-19]
+       _ = x[_Dot-20]
+       _ = x[_DotDotDot-21]
+       _ = x[_Break-22]
+       _ = x[_Case-23]
+       _ = x[_Chan-24]
+       _ = x[_Const-25]
+       _ = x[_Continue-26]
+       _ = x[_Default-27]
+       _ = x[_Defer-28]
+       _ = x[_Else-29]
+       _ = x[_Fallthrough-30]
+       _ = x[_For-31]
+       _ = x[_Func-32]
+       _ = x[_Go-33]
+       _ = x[_Goto-34]
+       _ = x[_If-35]
+       _ = x[_Import-36]
+       _ = x[_Interface-37]
+       _ = x[_Map-38]
+       _ = x[_Package-39]
+       _ = x[_Range-40]
+       _ = x[_Return-41]
+       _ = x[_Select-42]
+       _ = x[_Struct-43]
+       _ = x[_Switch-44]
+       _ = x[_Type-45]
+       _ = x[_Var-46]
+       _ = x[tokenCount-47]
+}
+
 const _token_name = "EOFnameliteralopop=opop=:=<-*([{)]},;:....breakcasechanconstcontinuedefaultdeferelsefallthroughforfuncgogotoifimportinterfacemappackagerangereturnselectstructswitchtypevar"
 
 var _token_index = [...]uint8{0, 3, 7, 14, 16, 19, 23, 24, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 42, 47, 51, 55, 60, 68, 75, 80, 84, 95, 98, 102, 104, 108, 110, 116, 125, 128, 135, 140, 146, 152, 158, 164, 168, 171, 171}
index 3b97cb66f24b976f8e6b99bbc64cc45c982f55b2..2936b6576bc7ae9517a7d1f0ff92ce20366c9a68 100644 (file)
@@ -6,7 +6,7 @@ package syntax
 
 type token uint
 
-//go:generate stringer -type token -linecomment
+//go:generate stringer -type token -linecomment tokens.go
 
 const (
        _    token = iota
@@ -105,7 +105,7 @@ const (
 
 type Operator uint
 
-//go:generate stringer -type Operator -linecomment
+//go:generate stringer -type Operator -linecomment tokens.go
 
 const (
        _ Operator = iota