Skip to content

Commit

Permalink
cmd/compile: restore constant folding optimization within OADDSTR
Browse files Browse the repository at this point in the history
Change-Id: Ib55f2458c75aee49302f0dd4e2a819f9931a5ed3
Reviewed-on: https://go-review.googlesource.com/c/go/+/166982
Run-TryBot: Matthew Dempsky <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Robert Griesemer <[email protected]>
  • Loading branch information
mdempsky committed Mar 13, 2019
1 parent a1b5cb1 commit 0a04c04
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/cmd/compile/internal/gc/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,17 +643,6 @@ func evconst(n *Node) {
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.Orig = &nl
nl.SetVal(Val{strings.Join(strs, "")})
Expand Down

0 comments on commit 0a04c04

Please sign in to comment.