]> Cypherpunks repositories - gostls13.git/commit
go/types: add UsesCgo config to support _cgo_gotypes.go
authorMatthew Dempsky <mdempsky@google.com>
Wed, 30 Nov 2016 01:27:15 +0000 (17:27 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 1 May 2020 18:01:39 +0000 (18:01 +0000)
commit3cec330fab5455c4dd00f1f6c228e146edd915d3
treeb7152249562b8b617b2d2d50d3e27fde90ac2fc5
parentb565d1ec1630f6ffa50024fe14ac4ea88a2e6701
go/types: add UsesCgo config to support _cgo_gotypes.go

(Reland of golang.org/cl/33677.)

This CL adds a UsesCgo config setting to go/types to specify that the
_cgo_gotypes.go file generated by cmd/cgo has been provided as a
source file. The type checker then internally resolves C.bar qualified
identifiers to _Cfoo_bar as appropriate.

It also adds support to srcimporter to automatically run cgo.
Unfortunately, this functionality is not compatible with overriding
OpenFile, because cmd/cgo and gcc will directly open files.

Updates #16623.
Updates #35721.

Change-Id: Ib179d55c8c589916f98ceeae0b9a3e746157253a
Reviewed-on: https://go-review.googlesource.com/c/go/+/231459
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/internal/srcimporter/srcimporter.go
src/go/internal/srcimporter/srcimporter_test.go
src/go/types/api.go
src/go/types/assignments.go
src/go/types/call.go
src/go/types/check.go
src/go/types/operand.go
src/go/types/package.go
src/go/types/resolver.go
src/go/types/universe.go