Commit 7a9aa069 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

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: default avatarMatthew Dempsky <mdempsky@google.com>
parent 8ee37c6a
...@@ -1589,10 +1589,8 @@ func (s *Sym) sconv(flag FmtFlag) string { ...@@ -1589,10 +1589,8 @@ func (s *Sym) sconv(flag FmtFlag) string {
return "_" return "_"
} }
sf := flag
sm := setfmode(&flag) sm := setfmode(&flag)
str := s.symfmt(flag) str := s.symfmt(flag)
flag = sf
fmtmode = sm fmtmode = sm
return str return str
} }
...@@ -1626,10 +1624,10 @@ func fldconv(f *Field, flag FmtFlag) string { ...@@ -1626,10 +1624,10 @@ func fldconv(f *Field, flag FmtFlag) string {
return "<T>" return "<T>"
} }
sf := flag unsigned := flag&FmtUnsigned != 0
sm := setfmode(&flag) sm := setfmode(&flag)
if fmtmode == FTypeId && (sf&FmtUnsigned != 0) { if fmtmode == FTypeId && unsigned {
fmtpkgpfx++ fmtpkgpfx++
} }
if fmtpkgpfx != 0 { if fmtpkgpfx != 0 {
...@@ -1687,11 +1685,10 @@ func fldconv(f *Field, flag FmtFlag) string { ...@@ -1687,11 +1685,10 @@ func fldconv(f *Field, flag FmtFlag) string {
str += " " + strconv.Quote(f.Note) str += " " + strconv.Quote(f.Note)
} }
if fmtmode == FTypeId && (sf&FmtUnsigned != 0) { if fmtmode == FTypeId && unsigned {
fmtpkgpfx-- fmtpkgpfx--
} }
flag = sf
fmtmode = sm fmtmode = sm
return str return str
} }
...@@ -1719,10 +1716,10 @@ func (t *Type) tconv(flag FmtFlag) string { ...@@ -1719,10 +1716,10 @@ func (t *Type) tconv(flag FmtFlag) string {
} }
t.Trecur++ t.Trecur++
sf := flag unsigned := flag&FmtUnsigned != 0
sm := setfmode(&flag) sm := setfmode(&flag)
if fmtmode == FTypeId && (sf&FmtUnsigned != 0) { if fmtmode == FTypeId && unsigned {
fmtpkgpfx++ fmtpkgpfx++
} }
if fmtpkgpfx != 0 { if fmtpkgpfx != 0 {
...@@ -1731,11 +1728,10 @@ func (t *Type) tconv(flag FmtFlag) string { ...@@ -1731,11 +1728,10 @@ func (t *Type) tconv(flag FmtFlag) string {
str := t.typefmt(flag) str := t.typefmt(flag)
if fmtmode == FTypeId && (sf&FmtUnsigned != 0) { if fmtmode == FTypeId && unsigned {
fmtpkgpfx-- fmtpkgpfx--
} }
flag = sf
fmtmode = sm fmtmode = sm
t.Trecur-- t.Trecur--
return str return str
...@@ -1753,7 +1749,6 @@ func (n *Node) nconv(s fmt.State, flag FmtFlag) { ...@@ -1753,7 +1749,6 @@ func (n *Node) nconv(s fmt.State, flag FmtFlag) {
return return
} }
sf := flag
sm := setfmode(&flag) sm := setfmode(&flag)
switch fmtmode { switch fmtmode {
...@@ -1769,7 +1764,6 @@ func (n *Node) nconv(s fmt.State, flag FmtFlag) { ...@@ -1769,7 +1764,6 @@ func (n *Node) nconv(s fmt.State, flag FmtFlag) {
Fatalf("unhandled %%N mode: %d", fmtmode) Fatalf("unhandled %%N mode: %d", fmtmode)
} }
flag = sf
fmtmode = sm fmtmode = sm
} }
...@@ -1794,7 +1788,6 @@ func (l Nodes) hconv(s fmt.State, flag FmtFlag) { ...@@ -1794,7 +1788,6 @@ func (l Nodes) hconv(s fmt.State, flag FmtFlag) {
return return
} }
sf := flag
sm := setfmode(&flag) sm := setfmode(&flag)
sep := "; " sep := "; "
if fmtmode == FDbg { if fmtmode == FDbg {
...@@ -1810,7 +1803,6 @@ func (l Nodes) hconv(s fmt.State, flag FmtFlag) { ...@@ -1810,7 +1803,6 @@ func (l Nodes) hconv(s fmt.State, flag FmtFlag) {
} }
} }
flag = sf
fmtmode = sm fmtmode = sm
} }
......
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