aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/noder.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2020-11-13 18:33:19 -0800
committerMatthew Dempsky <mdempsky@google.com>2020-11-24 19:41:59 +0000
commitc767d73227704ba4e22e366e89d1885f52d4b6cc (patch)
tree0117c4326bcaa4d7f717336be21adc7aa259b890 /src/cmd/compile/internal/gc/noder.go
parent6dae48fb0ba772d30c664a8a31732a46e980e536 (diff)
downloadgo-c767d73227704ba4e22e366e89d1885f52d4b6cc.tar.xz
[dev.regabi] cmd/compile: remove CTRUNE
Since CL 255217, we've been able to rely on types.UntypedRune to identify untyped rune literals, rather than needing Mpint.Rune / CTRUNE. This makes way for switching to using go/constant, which doesn't have a separate notion of rune constants distinct from integer constants. Passes toolstash-check. Change-Id: I319861f4758aeea17345c101b167cb307e706a0e Reviewed-on: https://go-review.googlesource.com/c/go/+/272652 Reviewed-by: Robert Griesemer <gri@golang.org> Trust: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/gc/noder.go')
-rw-r--r--src/cmd/compile/internal/gc/noder.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/gc/noder.go b/src/cmd/compile/internal/gc/noder.go
index 27bc9b5629..303b04cd46 100644
--- a/src/cmd/compile/internal/gc/noder.go
+++ b/src/cmd/compile/internal/gc/noder.go
@@ -656,6 +656,9 @@ func (p *noder) expr(expr syntax.Expr) *Node {
return p.mkname(expr)
case *syntax.BasicLit:
n := nodlit(p.basicLit(expr))
+ if expr.Kind == syntax.RuneLit {
+ n.Type = types.UntypedRune
+ }
n.SetDiag(expr.Bad) // avoid follow-on errors if there was a syntax error
return n
case *syntax.CompositeLit:
@@ -1428,7 +1431,6 @@ func (p *noder) basicLit(lit *syntax.BasicLit) Val {
case syntax.RuneLit:
x := new(Mpint)
- x.Rune = true
if !lit.Bad {
u, _ := strconv.Unquote(s)
var r rune