]> Cypherpunks repositories - gostls13.git/commit
cmd/fix: don't depend on *GetTypeID functions being present
authorKeith Randall <khr@golang.org>
Wed, 17 Jan 2018 18:38:10 +0000 (10:38 -0800)
committerKeith Randall <khr@golang.org>
Wed, 17 Jan 2018 20:35:43 +0000 (20:35 +0000)
commitbd89333426954e24167a9b78f1dd8b0483a560f8
tree0b3df0219e254c5cb06f89fcfed1fc699599dbdb
parent18d527b3f09521a21e4068917f9b4513fcfcc2ef
cmd/fix: don't depend on *GetTypeID functions being present

cgo uses the presence of these functions to determine whether
a given type is in the CFTypeRef hierarchy and thus should be
a uintptr instead of a pointer. But if the *GetTypeID functions
aren't used by the user code, then they won't be present in the
cgo output, and thus cmd/fix won't see them.

Use the simpler rule that anything ending in *Ref should be
rewritten. This could over-rewrite, but I don't see a simpler
solution. Unlike cgo, it is easy to edit the output to fix any
issues. And fix is a much rarer operation than cgo.

This is a revert of portions of CL 87616.

Update #23091

Change-Id: I74ecd9fb25490a3d279b372e107248452bb62185
Reviewed-on: https://go-review.googlesource.com/88075
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/fix/cftype.go
src/cmd/fix/jnitype.go
src/cmd/fix/typecheck.go