aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/logopt
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/logopt')
-rw-r--r--src/cmd/compile/internal/logopt/escape.go14
-rw-r--r--src/cmd/compile/internal/logopt/escape_bootstrap.go13
-rw-r--r--src/cmd/compile/internal/logopt/log_opts.go4
3 files changed, 2 insertions, 29 deletions
diff --git a/src/cmd/compile/internal/logopt/escape.go b/src/cmd/compile/internal/logopt/escape.go
deleted file mode 100644
index 9660e938b4..0000000000
--- a/src/cmd/compile/internal/logopt/escape.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build go1.8
-// +build go1.8
-
-package logopt
-
-import "net/url"
-
-func pathEscape(s string) string {
- return url.PathEscape(s)
-}
diff --git a/src/cmd/compile/internal/logopt/escape_bootstrap.go b/src/cmd/compile/internal/logopt/escape_bootstrap.go
deleted file mode 100644
index cc04eaadfd..0000000000
--- a/src/cmd/compile/internal/logopt/escape_bootstrap.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build !go1.8
-// +build !go1.8
-
-package logopt
-
-// For bootstrapping with an early version of Go
-func pathEscape(s string) string {
- panic("This should never be called; the compiler is not fully bootstrapped if it is.")
-}
diff --git a/src/cmd/compile/internal/logopt/log_opts.go b/src/cmd/compile/internal/logopt/log_opts.go
index 9fee83426f..09825e8278 100644
--- a/src/cmd/compile/internal/logopt/log_opts.go
+++ b/src/cmd/compile/internal/logopt/log_opts.go
@@ -376,7 +376,7 @@ func writerForLSP(subdirpath, file string) io.WriteCloser {
if lastdot != -1 {
basename = basename[:lastdot]
}
- basename = pathEscape(basename)
+ basename = url.PathEscape(basename)
// Assume a directory, make a file
p := filepath.Join(subdirpath, basename+".json")
@@ -428,7 +428,7 @@ func FlushLoggedOpts(ctxt *obj.Link, slashPkgPath string) {
if slashPkgPath == "" {
slashPkgPath = "\000"
}
- subdirpath := filepath.Join(dest, pathEscape(slashPkgPath))
+ subdirpath := filepath.Join(dest, url.PathEscape(slashPkgPath))
err := os.MkdirAll(subdirpath, 0755)
if err != nil {
log.Fatalf("Could not create directory %s for logging optimizer actions, %v", subdirpath, err)