mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.regabi] cmd/compile: refactor type/value assertions
Small refactoring to make subsequent CLs clearer. Passes toolstash-check. Change-Id: I1a6ae599f491220d44aaabae0b7bed4aff46ee92 Reviewed-on: https://go-review.googlesource.com/c/go/+/272651 Reviewed-by: Robert Griesemer <gri@golang.org> Trust: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
88a9e2f9ad
commit
6dae48fb0b
4 changed files with 23 additions and 9 deletions
|
|
@ -251,6 +251,9 @@ func (n *Node) SetVal(v Val) {
|
|||
Dump("have Opt", n)
|
||||
Fatalf("have Opt")
|
||||
}
|
||||
if n.Op == OLITERAL {
|
||||
assertRepresents(n.Type, v)
|
||||
}
|
||||
n.SetHasVal(true)
|
||||
n.E = v.U
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue