]> 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>
Thu, 23 Apr 2020 20:45:57 +0000 (20:45 +0000)
commit83d25c61e45f2d38e1015d6eef50cccc0dc0d9b3
treeb4fe57fb62bb06daba0d0db5f8de57babd7f549d
parent0ef3ebcc83a4f9d4442c0ffe251d7bb29f6de6a1
go/types: add UsesCgo config to support _cgo_gotypes.go

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: I1e1965fe41b765b7a9da3431f2a86cc16025dee2
Reviewed-on: https://go-review.googlesource.com/c/go/+/33677
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