]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: delete the "use" function and calls in non-generated files.
authorSameer Ajmani <sameer@golang.org>
Fri, 10 Feb 2017 14:22:35 +0000 (09:22 -0500)
committerSameer Ajmani <sameer@golang.org>
Mon, 13 Feb 2017 19:58:05 +0000 (19:58 +0000)
Delete use stub from asm.s, leaving only a dummy file.
Deleting the file causes Windows build to fail.

Fixes #16607

Change-Id: Ic5a55e042e588f1e1bc6605a3d309d1eabdeb288
Reviewed-on: https://go-review.googlesource.com/36716
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
12 files changed:
src/syscall/asm.s
src/syscall/dll_windows.go
src/syscall/syscall.go
src/syscall/syscall_darwin.go
src/syscall/syscall_dragonfly.go
src/syscall/syscall_freebsd.go
src/syscall/syscall_linux.go
src/syscall/syscall_linux_386.go
src/syscall/syscall_linux_arm.go
src/syscall/syscall_linux_mipsx.go
src/syscall/syscall_linux_s390x.go
src/syscall/syscall_plan9.go

index 06449ebfa9e5aaeee1b96d751e360a257f587ea1..c3bc40a5941844b3cd0d88787a3eb65fae545bd3 100644 (file)
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "textflag.h"
-
-TEXT ·use(SB),NOSPLIT,$0
-       RET
+// Dummy asm file to keep Windows building.
+// TODO(sameer): delete this after updating go tool
+// per Ian's comment in golang.org/cl/36716
index 864473b43b2909303317b5a82b511d8a5dd65adb..2ee85a0d77da1adb651cac78f1908a0d6289ec67 100644 (file)
@@ -87,7 +87,6 @@ func (d *DLL) FindProc(name string) (proc *Proc, err error) {
                return nil, err
        }
        a, e := getprocaddress(uintptr(d.Handle), namep)
-       use(unsafe.Pointer(namep))
        if e != 0 {
                return nil, &DLLError{
                        Err:     e,
index 2fbe624c1fc782548f4defbb13ea64b3c2660a0e..e8560a036d0fdbb97040195c9089c0aeded63b32 100644 (file)
@@ -26,8 +26,6 @@
 //
 package syscall
 
-import "unsafe"
-
 //go:generate go run mksyscall_windows.go -systemdll -output zsyscall_windows.go syscall_windows.go security_windows.go
 
 // StringByteSlice converts a string to a NUL-terminated []byte,
@@ -98,11 +96,3 @@ func (tv *Timeval) Nano() int64 {
 // Getpagesize is provided by the runtime.
 
 func Getpagesize() int
-
-// use is a no-op, but the compiler cannot see that it is.
-// Calling use(p) ensures that p is kept live until that point.
-// This was needed until Go 1.6 to call syscall.Syscall correctly.
-// As of Go 1.6 the compiler handles that case automatically.
-// The uses and definition of use can be removed early in the Go 1.7 cycle.
-//go:noescape
-func use(p unsafe.Pointer)
index 689bc14cf44d5d4d6433e0f9b69ff43e7ceea097..a1c360d4f48f6ee3c281b625f10c093b028e0697 100644 (file)
@@ -127,7 +127,6 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (
                uintptr(options),
                0,
        )
-       use(unsafe.Pointer(_p0))
        if e1 != 0 {
                return nil, e1
        }
@@ -180,7 +179,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
                bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
        }
        r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(_p0), bufsize, uintptr(flags))
-       use(unsafe.Pointer(_p0))
        n = int(r0)
        if e1 != 0 {
                err = e1
index 980687ccbd11a1eec3adec5b9787f612b39734b0..054183adef2f230fa827b2d9a049b6eafeeb1139 100644 (file)
@@ -100,7 +100,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
                bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
        }
        r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
-       use(unsafe.Pointer(_p0))
        n = int(r0)
        if e1 != 0 {
                err = e1
index 2a304cd2c66c6435d5964aa80b61ef5e98b90acc..4dc07fe3c8434b5a099a29da879af93c2198c174 100644 (file)
@@ -113,7 +113,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
                bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
        }
        r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
-       use(unsafe.Pointer(_p0))
        n = int(r0)
        if e1 != 0 {
                err = e1
index a8801ad5fd1549b865bdd465b5404723a538877c..8099a5fdeb87138c52b7b553296cb8991a9d2738 100644 (file)
@@ -127,7 +127,6 @@ func Futimesat(dirfd int, path string, tv []Timeval) (err error) {
                return err
        }
        err = futimesat(dirfd, pathp, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
-       use(unsafe.Pointer(pathp))
        return err
 }
 
@@ -790,7 +789,6 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
                return err
        }
        err = mount(source, target, fstype, flags, datap)
-       use(unsafe.Pointer(datap))
        return err
 }
 
index 00cf262738dacb3ea7e331b5a2f0aa80d3b16dd6..d08338b1dbcd86baa1cdf065bbe502f27e04901c 100644 (file)
@@ -354,7 +354,6 @@ func Statfs(path string, buf *Statfs_t) (err error) {
                return err
        }
        _, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
-       use(unsafe.Pointer(pathp))
        if e != 0 {
                err = e
        }
index 2ed31f0bb93161463b9dfab1588597ce22a4ae9f..a58ebd4ed1e5773645c9b3b1572890da10c5cffc 100644 (file)
@@ -123,7 +123,6 @@ func Statfs(path string, buf *Statfs_t) (err error) {
                return err
        }
        _, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(pathp)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
-       use(unsafe.Pointer(pathp))
        if e != 0 {
                err = e
        }
index 48e79eabee43c1c42de0c7c80d2be056b0ecfafc..1b072c13803355080f16b6c97ee5d1acfdbb59b0 100644 (file)
@@ -72,7 +72,6 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
 
 func Fstatfs(fd int, buf *Statfs_t) (err error) {
        _, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
-       use(unsafe.Pointer(buf))
        if e != 0 {
                err = errnoErr(e)
        }
@@ -85,7 +84,6 @@ func Statfs(path string, buf *Statfs_t) (err error) {
                return err
        }
        _, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(p)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf)))
-       use(unsafe.Pointer(p))
        if e != 0 {
                err = errnoErr(e)
        }
index 148790e7566f6324c4404d9210b518cf6afbd937..a1dd5d6fdb6bfff50b8213c91b9eb0e2af6d4026 100644 (file)
@@ -96,7 +96,6 @@ func Pipe2(p []int, flags int) (err error) {
 func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
        mmap_args := [6]uintptr{addr, length, uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)}
        r0, _, e1 := Syscall(SYS_MMAP, uintptr(unsafe.Pointer(&mmap_args[0])), 0, 0)
-       use(unsafe.Pointer(&mmap_args[0]))
        xaddr = uintptr(r0)
        if e1 != 0 {
                err = errnoErr(e1)
index 0691889e3112a301e87d492c76ef95625a1c5b4f..b7a0d543d94657f716fa8a7272d47f1869e2adde 100644 (file)
@@ -251,9 +251,7 @@ func Unmount(name, old string) (err error) {
                        return err
                }
                r0, _, e = Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(namep)), oldptr, 0)
-               use(unsafe.Pointer(namep))
        }
-       use(unsafe.Pointer(oldp))
 
        if int32(r0) == -1 {
                err = e