summaryrefslogtreecommitdiff
path: root/src/cmd/cgo/ast.go
AgeCommit message (Collapse)AuthorFilesLines
2011-04-26Imported Upstream version 2011.04.13upstream/2011.04.13Ondřej Surý1-9/+11
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý1-6/+15
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-221/+244
2010-04-09Add //export to cgo.Ian Lance Taylor1-0/+45
The new //export comment marks a Go function as callable from C. The syntax is "//export NAME" where NAME is the name of the function as seen from C. If such a comment is seen, cgo will generate two new files: _cgo_export.h and _cgo_export.c. The _cgo_export.h file provides declarations which C code may use to call Go functions. The _cgo_export.c file contains wrappers, and is to be compiled with gcc. The changes to Make.pkg support using this from a Go Makefile, though it could probably be more convenient. R=rsc CC=golang-dev http://codereview.appspot.com/853042
2010-03-30single argument panicRuss Cox1-1/+1
note that sortmain.go has been run through hg gofmt; only the formatting of the day initializers changed. i'm happy to revert that formatting if you'd prefer. stop on error in doc/progs/run R=r CC=golang-dev http://codereview.appspot.com/850041
2010-03-02gofmt: experiment: align values in map composites where possibleRobert Griesemer1-2/+2
- gofmt -w src misc - looking for feedback R=rsc, r CC=golang-dev http://codereview.appspot.com/223076
2010-02-24go/ast: streamline representation of field listsRobert Griesemer1-5/+7
- always include position information about opening/closing parens/braces - replace uses of []*ast.Field with *ast.FieldList Fixes issue 473. R=rsc CC=golang-dev http://codereview.appspot.com/223043
2010-02-19- removed exp/parser (support for old semicolon syntax)Robert Griesemer1-3/+2
- go/ast: removed StringList (not needed anymore) - go/ast: changed import path and field list tag to a single string - updated all dependencies R=rsc CC=golang-dev http://codereview.appspot.com/217056
2010-01-27More steps towards tracking of identifier scopes.Robert Griesemer1-1/+1
- provide scope to parse functions; if non-nil, parser uses the scope to declare and lookup identifiers - resolve forward references where possible R=rsc CC=golang-dev http://codereview.appspot.com/194098
2010-01-15 Steps towards tracking scopes for identifiers.Robert Griesemer1-3/+3
- Identifiers refer now to the language entity (Object) that they denote. At the moment this is at best an approximation. - Initial data structures for language entities (Objects) and expression types (Type) independent of the actual type notations. - Initial support for declaring and looking up identifiers. - Updated various dependent files and added support functions. - Extensively tested to avoid breakage. This is an AST change. R=rsc CC=golang-dev, rog http://codereview.appspot.com/189080
2010-01-11 cgo: Make constants #define'd in C available to Go (as consts)Devon H. O'Dell1-1/+2
Fixes issue 435 R=rsc CC=golang-dev http://codereview.appspot.com/181161 Committer: Russ Cox <rsc@golang.org>
2010-01-04Simplified parser interface.Robert Griesemer1-1/+1
R=rsc, r CC=golang-dev, rog http://codereview.appspot.com/183116
2009-12-23cgo: don't overwrite p.CrefsDevon H. O'Dell1-1/+3
It's expected to be shared between all files so that all types are output. Fixes bug reported on mailing list by Peter Froehlich. R=rsc, phf CC=golang-dev http://codereview.appspot.com/183043 Committer: Russ Cox <rsc@golang.org>
2009-12-17Allow cgo to accept multiple .go inputs for a packageDevon H. O'Dell1-3/+2
Fixes issue 342. R=rsc CC=golang-dev http://codereview.appspot.com/179062 Committer: Russ Cox <rsc@golang.org>
2009-12-15This patch enables cgo utility to correctly convert enums in the C sourceMoriyoshi Koizumi1-4/+6
into consts in the resulting Go source. Previously known as issue 161047, which I deleted accidentally. Fixes issue 207. R=rsc http://codereview.appspot.com/166059 Committer: Russ Cox <rsc@golang.org>
2009-12-15 1) Change default gofmt default settings forRobert Griesemer1-115/+115
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 1st set of files. R=rsc CC=agl, golang-dev, iant, ken2, r http://codereview.appspot.com/180047
2009-11-19Permit omission of hi bound in slices.Robert Griesemer1-0/+3
R=r, rsc http://codereview.appspot.com/157082
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer1-36/+36
R=rsc, r http://go/go-review/1025029
2009-10-06apply gofmt to the LGTM-marked files from 34501Russ Cox1-26/+25
that have not changed since I applied gofmt. R=gri DELTA=456 (77 added, 3 deleted, 376 changed) OCL=35378 CL=35383
2009-10-038c, 8l dynamic loading support.Russ Cox1-0/+1
better mach binaries. cgo working on darwin+linux amd64+386. eliminated context switches - pi is 30x faster. add libcgo to build. on snow leopard: - non-cgo binaries work; all tests pass. - cgo binaries work on amd64 but not 386. R=r DELTA=2031 (1316 added, 626 deleted, 89 changed) OCL=35264 CL=35304
2009-09-30cgo working on linux/386Russ Cox1-0/+1
R=r DELTA=70 (47 added, 4 deleted, 19 changed) OCL=35167 CL=35171
2009-09-30cgo: works on amd64.Russ Cox1-19/+1
integrated into Makefiles (see misc/cgo/gmp/Makefile). R=r DELTA=1110 (540 added, 525 deleted, 45 changed) OCL=35153 CL=35158
2009-09-24cgo checkpoint.Russ Cox1-18/+70
can write all 3 output files and then compile them by hand. R=r DELTA=919 (841 added, 16 deleted, 62 changed) OCL=34954 CL=34973
2009-09-18cgo: can look up C identifier kind (type or value) and typeRuss Cox1-0/+288
gmp.go:197:4: type mpz_t C type mpz_t gmp.go:205:2: call mpz_init C value func(mpz_ptr) void gmp.go:206:2: call mpz_set C value func(mpz_ptr, mpz_srcptr) void gmp.go:221:2: call mpz_init C value func(mpz_ptr) void gmp.go:227:7: call size_t C type size_t gmp.go:228:2: call mpz_export C value func(*void, *size_t, int, size_t, int, size_t, mpz_srcptr) *void gmp.go:235:13: call mpz_sizeinbase C value func(mpz_srcptr, int) size_t gmp.go:241:2: call mpz_set C value func(mpz_ptr, mpz_srcptr) void gmp.go:252:3: call mpz_import C value func(mpz_ptr, size_t, int, size_t, int, size_t, *const void) void gmp.go:261:2: call mpz_set_si C value func(mpz_ptr, long int) void gmp.go:273:5: call mpz_set_str C value func(mpz_ptr, *const char, int) int gmp.go:282:9: call mpz_get_str C value func(*char, int, mpz_srcptr) *char gmp.go:287:3: call mpz_clear C value func(mpz_ptr) void gmp.go:302:2: call mpz_add C value func(mpz_ptr, mpz_srcptr, mpz_srcptr) void gmp.go:311:2: call mpz_sub C value func(mpz_ptr, mpz_srcptr, mpz_srcptr) void gmp.go:320:2: call mpz_mul C value func(mpz_ptr, mpz_srcptr, mpz_srcptr) void gmp.go:329:2: call mpz_tdiv_q C value func(mpz_ptr, mpz_srcptr, mpz_srcptr) void gmp.go:339:2: call mpz_tdiv_r C value func(mpz_ptr, mpz_srcptr, mpz_srcptr) void gmp.go:348:2: call mpz_mul_2exp C value func(mpz_ptr, mpz_srcptr, long unsigned int) void gmp.go:356:2: call mpz_div_2exp C value func(mpz_ptr, mpz_srcptr, long unsigned int) void gmp.go:367:3: call mpz_pow_ui C value func(mpz_ptr, mpz_srcptr, long unsigned int) void gmp.go:369:3: call mpz_powm C value func(mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr) void gmp.go:378:2: call mpz_neg C value func(mpz_ptr, mpz_srcptr) void gmp.go:386:2: call mpz_abs C value func(mpz_ptr, mpz_srcptr) void gmp.go:404:9: call mpz_cmp C value func(mpz_srcptr, mpz_srcptr) int gmp.go:413:2: call mpz_tdiv_qr C value func(mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr) void gmp.go:426:2: call mpz_gcdext C value func(mpz_ptr, mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr) void R=r DELTA=938 (628 added, 308 deleted, 2 changed) OCL=34733 CL=34791