]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: build unique C type cache keys from parent names
authorTai <letientai299@gmail.com>
Tue, 11 Jun 2019 20:57:02 +0000 (04:57 +0800)
committerIan Lance Taylor <iant@golang.org>
Sat, 5 Oct 2019 00:16:04 +0000 (00:16 +0000)
commite13a4d9586917edb657a869736953b30a32c31d4
treecd18af3fc2b99dad31e122101976a127c68aabab
parent5f4aa5d79fba270d6a14f2a55999b5b6ccec2326
cmd/cgo: build unique C type cache keys from parent names

When translating C types, cache the in-progress type under its parent
names, so that anonymous structs can also be translated for multiple
typedefs, without clashing.

Standalone types are not affected by this change.

Also updated the test for issue 9026 because the C struct name
generation algorithm has changed.

Fixes #31891

Change-Id: I00cc64852a2617ce33da13f74caec886af05b9f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/181857
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
misc/cgo/test/cgo_test.go
misc/cgo/test/issue31891.c [new file with mode: 0644]
misc/cgo/test/testdata/issue9026/issue9026.go
misc/cgo/test/testx.go
src/cmd/cgo/gcc.go