diff options
| author | Russ Cox <rsc@golang.org> | 2020-12-06 13:54:50 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2020-12-07 20:41:11 +0000 |
| commit | bb4a37bd9316a04c45845634a721ef44d8b5b787 (patch) | |
| tree | 73f3151247682e9f64b8773e40473667bd3009f9 /src/cmd/compile/internal/gc/obj.go | |
| parent | 70155cca81d061686d4f23b7ad59fe8213e87f9f (diff) | |
| download | go-git-bb4a37bd9316a04c45845634a721ef44d8b5b787.tar.gz | |
[dev.regabi] cmd/compile: move Type, Sym printing to package types [generated]
Move the printing of types.Type and types.Sym out of ir
into package types, where it properly belongs. This wasn't
done originally (when the code was in gc) because the Type
and Sym printing was a bit tangled up with the Node printing.
But now they are untangled and can move into the correct
package.
This CL is automatically generated.
A followup CL will clean up a little bit more by hand.
Passes buildall w/ toolstash -cmp.
[git-generate]
cd src/cmd/compile/internal/ir
rf '
mv FmtMode fmtMode
mv FErr fmtGo
mv FDbg fmtDebug
mv FTypeId fmtTypeID
mv FTypeIdName fmtTypeIDName
mv methodSymName SymMethodName
mv BuiltinPkg LocalPkg BlankSym OrigSym NumImport \
fmtMode fmtGo symFormat sconv sconv2 symfmt SymMethodName \
BasicTypeNames fmtBufferPool InstallTypeFormats typeFormat tconv tconv2 fldconv FmtConst \
typefmt.go
mv typefmt.go cmd/compile/internal/types
'
cd ../types
mv typefmt.go fmt.go
Change-Id: I6f3fd818323733ab8446f00594937c1628760b27
Reviewed-on: https://go-review.googlesource.com/c/go/+/275779
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/gc/obj.go')
| -rw-r--r-- | src/cmd/compile/internal/gc/obj.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/gc/obj.go b/src/cmd/compile/internal/gc/obj.go index b1701b30a1..c34a86d4eb 100644 --- a/src/cmd/compile/internal/gc/obj.go +++ b/src/cmd/compile/internal/gc/obj.go @@ -84,7 +84,7 @@ func printObjHeader(bout *bio.Writer) { if base.Flag.BuildID != "" { fmt.Fprintf(bout, "build id %q\n", base.Flag.BuildID) } - if ir.LocalPkg.Name == "main" { + if types.LocalPkg.Name == "main" { fmt.Fprintf(bout, "main\n") } fmt.Fprintf(bout, "\n") // header ends with blank line @@ -200,7 +200,7 @@ func dumpLinkerObj(bout *bio.Writer) { } func addptabs() { - if !base.Ctxt.Flag_dynlink || ir.LocalPkg.Name != "main" { + if !base.Ctxt.Flag_dynlink || types.LocalPkg.Name != "main" { return } for _, exportn := range exportlist { @@ -235,7 +235,7 @@ func dumpGlobal(n ir.Node) { if n.Class() == ir.PFUNC { return } - if n.Sym().Pkg != ir.LocalPkg { + if n.Sym().Pkg != types.LocalPkg { return } dowidth(n.Type()) @@ -248,7 +248,7 @@ func dumpGlobalConst(n ir.Node) { if t == nil { return } - if n.Sym().Pkg != ir.LocalPkg { + if n.Sym().Pkg != types.LocalPkg { return } // only export integer constants for now @@ -478,7 +478,7 @@ var slicedataGen int func slicedata(pos src.XPos, s string) ir.Node { slicedataGen++ symname := fmt.Sprintf(".gobytes.%d", slicedataGen) - sym := ir.LocalPkg.Lookup(symname) + sym := types.LocalPkg.Lookup(symname) symnode := NewName(sym) sym.Def = symnode |
