[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>
This commit is contained in:
Matthew Dempsky 2020-11-13 18:33:19 -08:00
parent 6dae48fb0b
commit c767d73227
7 changed files with 72 additions and 88 deletions

View file

@ -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