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

@ -75,7 +75,7 @@ var (
func NewParFor(nthrmax uint32) *ParFor {
mp := acquirem()
mp.scalararg[0] = uint(nthrmax)
mp.scalararg[0] = uintptr(nthrmax)
onM(&newparfor_m)
desc := (*ParFor)(mp.ptrarg[0])
mp.ptrarg[0] = nil
@ -88,8 +88,8 @@ func ParForSetup(desc *ParFor, nthr, n uint32, ctx *byte, wait bool, body func(*
mp.ptrarg[0] = unsafe.Pointer(desc)
mp.ptrarg[1] = unsafe.Pointer(ctx)
mp.ptrarg[2] = **(**unsafe.Pointer)(unsafe.Pointer(&body))
mp.scalararg[0] = uint(nthr)
mp.scalararg[1] = uint(n)
mp.scalararg[0] = uintptr(nthr)
mp.scalararg[1] = uintptr(n)
mp.scalararg[2] = 0
if wait {
mp.scalararg[2] = 1
@ -108,7 +108,7 @@ func ParForDo(desc *ParFor) {
func ParForIters(desc *ParFor, tid uint32) (uint32, uint32) {
mp := acquirem()
mp.ptrarg[0] = unsafe.Pointer(desc)
mp.scalararg[0] = uint(tid)
mp.scalararg[0] = uintptr(tid)
onM(&parforiters_m)
begin := uint32(mp.scalararg[0])
end := uint32(mp.scalararg[1])