cmd/internal/gc: delete Strlit, Zconv
Strlit was just a poor excuse for a Go string.
Use a Go string.
In the one case where it was a string-or-nil (Type.Note), use a *string.
Zconv was a poor excuse for %q. Use %q.
The only important part about Zconv's implementation
was that the compiler and linker agreed on the quoting rules.
Now they both use %q instead of having two Zconvs.
This CL *does* change the generated object files, because the
quoted strings end up in symbol names.
For example the string "\r\n" used to be named go.string."\r\n"
and is now go.string."\x0d\n".
Change-Id: I5c0d38e1570ffc495f0db1a20273c9564104a7e8
Reviewed-on: https://go-review.googlesource.com/6519
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
diff --git a/src/cmd/internal/gc/reflect.go b/src/cmd/internal/gc/reflect.go
index e2be03d..a1ddf77 100644
--- a/src/cmd/internal/gc/reflect.go
+++ b/src/cmd/internal/gc/reflect.go
@@ -28,7 +28,7 @@
if b.pkg == nil {
return +1
}
- return stringsCompare(a.pkg.Path.S, b.pkg.Path.S)
+ return stringsCompare(a.pkg.Path, b.pkg.Path)
}
func lsort(l *Sig, f func(*Sig, *Sig) int) *Sig {
@@ -473,7 +473,7 @@
}
if dimportpath_gopkg == nil {
- dimportpath_gopkg = mkpkg(newstrlit("go"))
+ dimportpath_gopkg = mkpkg("go")
dimportpath_gopkg.Name = "go"
}
@@ -502,7 +502,7 @@
var ns *Sym
if ns == nil {
- ns = Pkglookup("importpath.\"\".", mkpkg(newstrlit("go")))
+ ns = Pkglookup("importpath.\"\".", mkpkg("go"))
}
return dsymptr(s, ot, ns, 0)
}
@@ -1280,7 +1280,7 @@
if flag_race != 0 {
dimportpath(racepkg)
}
- dimportpath(mkpkg(newstrlit("main")))
+ dimportpath(mkpkg("main"))
}
}