1
0
mirror of https://github.com/golang/go synced 2024-11-05 17:46:16 -07:00
go/misc/cgo
Matthew Dempsky b565d1ec16 cmd/cgo: use type aliases for #define type macros
Cgo's initial design for handling "#define foo int*" involved
rewriting "C.foo" to "*_Ctype_int" everywhere. But now that we have
type aliases, we can declare "type _Ctype_foo = *_Ctype_int" once, and
then rewrite "C.foo" to just "_Ctype_foo".

This is important for go/types's UsesCgo mode, where go/types needs to
be able to figure out a type for each C.foo identifier using only the
information written into _cgo_gotypes.go.

Fixes #38649.

Change-Id: Ia0f8c2d82df81efb1be5bc26195ea9154c0af871
Reviewed-on: https://go-review.googlesource.com/c/go/+/230037
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-05-01 18:01:28 +00:00
..
errors cmd/cgo: do not rewrite call if there are more args than parameters 2019-07-12 17:31:29 +00:00
fortran misc/cgo/fortran: avoid writing to $PWD 2019-11-20 22:37:23 +00:00
gmp all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
life misc: remove use of relative directories in overlayDir functions 2019-11-25 16:26:15 +00:00
nocgo cmd/ld: really import runtime/cgo for external link 2014-05-20 21:36:50 -07:00
stdio misc: remove use of relative directories in overlayDir functions 2019-11-25 16:26:15 +00:00
test cmd/cgo: use type aliases for #define type macros 2020-05-01 18:01:28 +00:00
testasan misc: log 'ok' from 'go run' tests on success 2019-11-25 16:43:27 +00:00
testcarchive all: remove scattered remnants of darwin/arm 2020-04-08 18:35:49 +00:00
testcshared all: remove scattered remnants of darwin/arm 2020-04-08 18:35:49 +00:00
testgodefs cmd/cgo: use type aliases for #define type macros 2020-05-01 18:01:28 +00:00
testplugin misc: remove use of relative directories in overlayDir functions 2019-11-25 16:26:15 +00:00
testsanitizers runtime: save/restore callee saved registers in arm64's sigtramp 2019-06-03 19:02:11 +00:00
testshared test: fix -test.v trace output for cgo/testshared 2020-03-20 14:28:59 +00:00
testsigfwd misc: log 'ok' from 'go run' tests on success 2019-11-25 16:43:27 +00:00
testso all: remove scattered remnants of darwin/arm 2020-04-08 18:35:49 +00:00
testsovar all: remove scattered remnants of darwin/arm 2020-04-08 18:35:49 +00:00
testtls all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00