1
0
mirror of https://github.com/golang/go synced 2024-10-04 06:21:23 -06:00
go/src/cmd
Russ Cox 67c83db60d runtime: use goc2c as much as possible
Package runtime's C functions written to be called from Go
started out written in C using carefully constructed argument
lists and the FLUSH macro to write a result back to memory.

For some functions, the appropriate parameter list ended up
being architecture-dependent due to differences in alignment,
so we added 'goc2c', which takes a .goc file containing Go func
declarations but C bodies, rewrites the Go func declaration to
equivalent C declarations for the target architecture, adds the
needed FLUSH statements, and writes out an equivalent C file.
That C file is compiled as part of package runtime.

Native Client's x86-64 support introduces the most complex
alignment rules yet, breaking many functions that could until
now be portably written in C. Using goc2c for those avoids the
breakage.

Separately, Keith's work on emitting stack information from
the C compiler would require the hand-written functions
to add #pragmas specifying how many arguments are result
parameters. Using goc2c for those avoids maintaining #pragmas.

For both reasons, use goc2c for as many Go-called C functions
as possible.

This CL is a replay of the bulk of CL 15400047 and CL 15790043,
both of which were reviewed as part of the NaCl port and are
checked in to the NaCl branch. This CL is part of bringing the
NaCl code into the main tree.

No new code here, just reformatting and occasional movement
into .h files.

LGTM=r
R=dave, alex.brainman, r
CC=golang-codereviews
https://golang.org/cl/65220044
2014-02-20 15:58:47 -05:00
..
5a cmd/cc, cmd/gc, cmd/ld: consolidate print format routines 2014-02-12 14:29:11 -05:00
5c cmd/cc, cmd/gc, cmd/ld: consolidate print format routines 2014-02-12 14:29:11 -05:00
5g cmd/5g, cmd/8g: zero ambiguously live values on entry 2014-02-19 17:08:55 -05:00
5l cmd/gc: rename AFATVARDEF to AVARDEF 2014-02-13 22:17:22 -05:00
6a cmd/cc, cmd/gc, cmd/ld: consolidate print format routines 2014-02-12 14:29:11 -05:00
6c cmd/6c, cmd/8c, cmd/8g: fix print of pc (which is vlong). 2014-02-13 03:09:03 -05:00
6g cmd/gc: correct liveness for fat variables 2014-02-15 10:58:55 -05:00
6l cmd/gc: rename AFATVARDEF to AVARDEF 2014-02-13 22:17:22 -05:00
8a cmd/cc, cmd/gc, cmd/ld: consolidate print format routines 2014-02-12 14:29:11 -05:00
8c cmd/6c, cmd/8c, cmd/8g: fix print of pc (which is vlong). 2014-02-13 03:09:03 -05:00
8g cmd/5g, cmd/8g: zero ambiguously live values on entry 2014-02-19 17:08:55 -05:00
8l cmd/gc: rename AFATVARDEF to AVARDEF 2014-02-13 22:17:22 -05:00
addr2line cmd/addr2line: reimplement in Go 2014-02-19 14:33:11 -05:00
api cmd/api: ensure GOPATH always points to the correct go.tools 2014-01-14 16:56:22 +11:00
cc cmd/cc, cmd/gc, cmd/ld: consolidate print format routines 2014-02-12 14:29:11 -05:00
cgo cmd/cgo: use __gcc_struct__ for go exported functions 2013-12-10 11:30:12 +11:00
dist runtime: use goc2c as much as possible 2014-02-20 15:58:47 -05:00
fix cmd/fix: remove obsolete testdata. 2013-06-02 15:40:32 +02:00
gc cmd/gc: explain 'nointerface' method failure 2014-02-20 15:42:08 -05:00
go cmd/addr2line: reimplement in Go 2014-02-19 14:33:11 -05:00
gofmt cmd/gofmt: remove -tabwidth and -tabs flags 2014-01-14 11:10:56 -08:00
ld cmd/ld: fix off-by-one error in DWARF .debug_line transcription 2014-02-20 09:06:32 -08:00
link cmd/link: change cloneProg to return the cloned value 2014-02-18 17:59:44 -08:00
nm debug/plan9obj: implement parsing of Plan 9 a.out executables 2014-01-22 23:30:52 +01:00
objdump runtime/pprof: support OS X CPU profiling 2012-02-28 16:18:24 -05:00
pack cmd/pack: fix match 2014-02-20 15:50:30 -05:00
prof libmach: use different names for different Ureg types 2014-01-08 20:37:27 -05:00
yacc cmd/yacc: expr example support windows 2013-12-19 12:14:07 -05:00