summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2016-11-07 15:50:16 -0800
committerJosh Bleecher Snyder <josharian@gmail.com>2017-03-14 02:34:38 +0000
commit7a9aa06902540803773f22cd868bc5809dddad02 (patch)
treee48c03c29aea8e9b2fa538739fe61ba9201dab18
parent8ee37c6a66fd71fa0204204719b0489085f85ca0 (diff)
downloadgo-git-7a9aa06902540803773f22cd868bc5809dddad02.tar.gz
cmd/compile: remove FmtFlag save and restore
It is unnecessary. Passes toolstash -cmp. Change-Id: I7c03523b6110c3d9bd5ba2b37d9a1e17a7ae570e Reviewed-on: https://go-review.googlesource.com/38145 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-rw-r--r--src/cmd/compile/internal/gc/fmt.go20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/cmd/compile/internal/gc/fmt.go b/src/cmd/compile/internal/gc/fmt.go
index ba3c1d8bb9..bddaeed3ac 100644
--- a/src/cmd/compile/internal/gc/fmt.go
+++ b/src/cmd/compile/internal/gc/fmt.go
@@ -1589,10 +1589,8 @@ func (s *Sym) sconv(flag FmtFlag) string {
return "_"
}
- sf := flag
sm := setfmode(&flag)
str := s.symfmt(flag)
- flag = sf
fmtmode = sm
return str
}
@@ -1626,10 +1624,10 @@ func fldconv(f *Field, flag FmtFlag) string {
return "<T>"
}
- sf := flag
+ unsigned := flag&FmtUnsigned != 0
sm := setfmode(&flag)
- if fmtmode == FTypeId && (sf&FmtUnsigned != 0) {
+ if fmtmode == FTypeId && unsigned {
fmtpkgpfx++
}
if fmtpkgpfx != 0 {
@@ -1687,11 +1685,10 @@ func fldconv(f *Field, flag FmtFlag) string {
str += " " + strconv.Quote(f.Note)
}
- if fmtmode == FTypeId && (sf&FmtUnsigned != 0) {
+ if fmtmode == FTypeId && unsigned {
fmtpkgpfx--
}
- flag = sf
fmtmode = sm
return str
}
@@ -1719,10 +1716,10 @@ func (t *Type) tconv(flag FmtFlag) string {
}
t.Trecur++
- sf := flag
+ unsigned := flag&FmtUnsigned != 0
sm := setfmode(&flag)
- if fmtmode == FTypeId && (sf&FmtUnsigned != 0) {
+ if fmtmode == FTypeId && unsigned {
fmtpkgpfx++
}
if fmtpkgpfx != 0 {
@@ -1731,11 +1728,10 @@ func (t *Type) tconv(flag FmtFlag) string {
str := t.typefmt(flag)
- if fmtmode == FTypeId && (sf&FmtUnsigned != 0) {
+ if fmtmode == FTypeId && unsigned {
fmtpkgpfx--
}
- flag = sf
fmtmode = sm
t.Trecur--
return str
@@ -1753,7 +1749,6 @@ func (n *Node) nconv(s fmt.State, flag FmtFlag) {
return
}
- sf := flag
sm := setfmode(&flag)
switch fmtmode {
@@ -1769,7 +1764,6 @@ func (n *Node) nconv(s fmt.State, flag FmtFlag) {
Fatalf("unhandled %%N mode: %d", fmtmode)
}
- flag = sf
fmtmode = sm
}
@@ -1794,7 +1788,6 @@ func (l Nodes) hconv(s fmt.State, flag FmtFlag) {
return
}
- sf := flag
sm := setfmode(&flag)
sep := "; "
if fmtmode == FDbg {
@@ -1810,7 +1803,6 @@ func (l Nodes) hconv(s fmt.State, flag FmtFlag) {
}
}
- flag = sf
fmtmode = sm
}