Commit 0a04c043 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile: restore constant folding optimization within OADDSTR

Change-Id: Ib55f2458c75aee49302f0dd4e2a819f9931a5ed3
Reviewed-on: https://go-review.googlesource.com/c/go/+/166982
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
parent a1b5cb1d
...@@ -643,17 +643,6 @@ func evconst(n *Node) { ...@@ -643,17 +643,6 @@ func evconst(n *Node) {
i2++ i2++
} }
// Hack to appease toolstash. Because
// we were checking isGoConst early
// on, we wouldn't collapse adjacent
// string constants unless the entire
// string was a constant.
//
// TODO(mdempsky): Remove in next commit.
if i1 != 0 || i2 != len(s) {
return
}
nl := *s[i1] nl := *s[i1]
nl.Orig = &nl nl.Orig = &nl
nl.SetVal(Val{strings.Join(strs, "")}) nl.SetVal(Val{strings.Join(strs, "")})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment