mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cgo: do not reset tag generator between files
Clean up an error message and error exit too. Insert blank line after "DO NOT EDIT" comment to keep it from being a doc comment. Fixes #1213. Fixes #1222. R=r CC=golang-dev https://golang.org/cl/3608042
This commit is contained in:
parent
e7a0f67603
commit
9da73612ed
6 changed files with 72 additions and 8 deletions
|
|
@ -593,10 +593,10 @@ type typeConv struct {
|
|||
string ast.Expr
|
||||
|
||||
ptrSize int64
|
||||
|
||||
tagGen int
|
||||
}
|
||||
|
||||
var tagGen int
|
||||
|
||||
func (c *typeConv) Init(ptrSize int64) {
|
||||
c.ptrSize = ptrSize
|
||||
c.m = make(map[dwarf.Type]*Type)
|
||||
|
|
@ -799,8 +799,8 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
|
|||
// Have to give it a name to simulate C "struct foo" references.
|
||||
tag := dt.StructName
|
||||
if tag == "" {
|
||||
tag = "__" + strconv.Itoa(c.tagGen)
|
||||
c.tagGen++
|
||||
tag = "__" + strconv.Itoa(tagGen)
|
||||
tagGen++
|
||||
} else if t.C == "" {
|
||||
t.C = dt.Kind + " " + tag
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue