cmd/cc, runtime: preserve C runtime type names in generated Go

uintptr or uint64 in the runtime C were turning into uint in the Go,
bool was turning into uint8, and so on. Fix that.

Also delete Go wrappers for C functions.
The C functions can be called directly now
(but still eventually need to be converted to Go).

LGTM=bradfitz, minux, iant
R=golang-codereviews, bradfitz, iant, minux
CC=golang-codereviews, khr, r
https://golang.org/cl/138740043
This commit is contained in:
Russ Cox 2014-08-27 21:59:49 -04:00
parent 43d4f93c91
commit d21638b5ec
34 changed files with 247 additions and 340 deletions

View file

@ -47,7 +47,7 @@ func growslice(t *slicetype, old sliceStruct, n int64) sliceStruct {
}
if raceenabled {
callerpc := gogetcallerpc(unsafe.Pointer(&t))
callerpc := getcallerpc(unsafe.Pointer(&t))
fn := growslice
pc := **(**uintptr)(unsafe.Pointer(&fn))
racereadrangepc(old.array, old.len*int(t.elem.size), callerpc, pc)
@ -104,7 +104,7 @@ func slicecopy(to sliceStruct, fm sliceStruct, width uintptr) int {
}
if raceenabled {
callerpc := gogetcallerpc(unsafe.Pointer(&to))
callerpc := getcallerpc(unsafe.Pointer(&to))
fn := slicecopy
pc := **(**uintptr)(unsafe.Pointer(&fn))
racewriterangepc(to.array, n*int(width), callerpc, pc)
@ -132,7 +132,7 @@ func slicestringcopy(to []byte, fm string) int {
}
if raceenabled {
callerpc := gogetcallerpc(unsafe.Pointer(&to))
callerpc := getcallerpc(unsafe.Pointer(&to))
fn := slicestringcopy
pc := **(**uintptr)(unsafe.Pointer(&fn))
racewriterangepc(unsafe.Pointer(&to[0]), n, callerpc, pc)