]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: consistenly use CTxxx for works relate to Ctype
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Sun, 13 Oct 2019 16:37:14 +0000 (23:37 +0700)
committerKeith Randall <khr@golang.org>
Mon, 14 Oct 2019 17:44:32 +0000 (17:44 +0000)
Passes toolstash-check

Change-Id: Iaeaf2575b9f492e45619007438c0138f9d22006c
Reviewed-on: https://go-review.googlesource.com/c/go/+/200959
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/const.go
src/cmd/compile/internal/gc/order.go

index 3666ddbaa0df69b24aff7949ed2b441ca0e0a642..0c03aad12b0cf00cc6c3e1be55b1b4f24d5ad807 100644 (file)
@@ -552,7 +552,7 @@ func tostr(v Val) Val {
 
 func consttype(n *Node) Ctype {
        if n == nil || n.Op != OLITERAL {
-               return 0
+               return CTxxx
        }
        return n.Val().Ctype()
 }
index 0e28f8267f07e2b8a62443a8a7a6550517e9881d..939f3df93abba0d4517aaadb5896ed27f4c144c0 100644 (file)
@@ -202,7 +202,7 @@ func isaddrokay(n *Node) bool {
 // The result of addrTemp MUST be assigned back to n, e.g.
 //     n.Left = o.addrTemp(n.Left)
 func (o *Order) addrTemp(n *Node) *Node {
-       if consttype(n) > 0 {
+       if consttype(n) != CTxxx {
                // TODO: expand this to all static composite literal nodes?
                n = defaultlit(n, nil)
                dowidth(n.Type)