X Tutup
Skip to content

Commit 27067df

Browse files
committed
cmd/internal/obj: cleanups from C transition and delete dead code
Change-Id: Id1ecad2565edd5937a764dcf56b89263353f47c2 Reviewed-on: https://go-review.googlesource.com/8947 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
1 parent 485f348 commit 27067df

File tree

2 files changed

+20
-76
lines changed

2 files changed

+20
-76
lines changed

src/cmd/internal/obj/fmt.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@
1515
package obj
1616

1717
const (
18-
FmtWidth = 1
19-
FmtLeft = FmtWidth << 1
20-
FmtPrec = FmtLeft << 1
21-
FmtSharp = FmtPrec << 1
22-
FmtSpace = FmtSharp << 1
23-
FmtSign = FmtSpace << 1
24-
FmtApost = FmtSign << 1
25-
FmtZero = FmtApost << 1
26-
FmtUnsigned = FmtZero << 1
27-
FmtShort = FmtUnsigned << 1
28-
FmtLong = FmtShort << 1
29-
FmtVLong = FmtLong << 1
30-
FmtComma = FmtVLong << 1
31-
FmtByte = FmtComma << 1
32-
FmtLDouble = FmtByte << 1
33-
FmtFlag = FmtLDouble << 1
18+
FmtWidth = 1 << iota
19+
FmtLeft
20+
FmtPrec
21+
FmtSharp
22+
FmtSpace
23+
FmtSign
24+
FmtApost
25+
FmtZero
26+
FmtUnsigned
27+
FmtShort
28+
FmtLong
29+
FmtVLong
30+
FmtComma
31+
FmtByte
32+
FmtLDouble
33+
FmtFlag
3434
)

src/cmd/internal/obj/go.go

Lines changed: 4 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ package obj
66

77
import (
88
"fmt"
9-
"math"
109
"os"
1110
"strings"
1211
)
1312

1413
// go-specific code shared across loaders (5l, 6l, 8l).
1514

16-
var Framepointer_enabled int
17-
18-
var Fieldtrack_enabled int
15+
var (
16+
Framepointer_enabled int
17+
Fieldtrack_enabled int
18+
)
1919

2020
// Toolchain experiments.
2121
// These are controlled by the GOEXPERIMENT environment
@@ -51,15 +51,6 @@ func init() {
5151
}
5252
}
5353

54-
// replace all "". with pkg.
55-
func Expandpkg(t0 string, pkg string) string {
56-
return strings.Replace(t0, `"".`, pkg+".", -1)
57-
}
58-
59-
func double2ieee(ieee *uint64, f float64) {
60-
*ieee = math.Float64bits(f)
61-
}
62-
6354
func Nopout(p *Prog) {
6455
p.As = ANOP
6556
p.Scond = 0
@@ -76,53 +67,6 @@ func Nocache(p *Prog) {
7667
p.To.Class = 0
7768
}
7869

79-
/*
80-
* bv.c
81-
*/
82-
83-
/*
84-
* closure.c
85-
*/
86-
87-
/*
88-
* const.c
89-
*/
90-
91-
/*
92-
* cplx.c
93-
*/
94-
95-
/*
96-
* dcl.c
97-
*/
98-
99-
/*
100-
* esc.c
101-
*/
102-
103-
/*
104-
* export.c
105-
*/
106-
107-
/*
108-
* fmt.c
109-
*/
110-
111-
/*
112-
* gen.c
113-
*/
114-
115-
/*
116-
* init.c
117-
*/
118-
119-
/*
120-
* inl.c
121-
*/
122-
123-
/*
124-
* lex.c
125-
*/
12670
func Expstring() string {
12771
buf := "X"
12872
for i := range exper {

0 commit comments

Comments
 (0)
X Tutup