mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-14 07:53:40 +00:00
compiler: refactor method names
This commit includes two changes:
* It makes unexported interface methods package-private, so that it's
not possible to type-assert on an unexported method in a different
package.
* It makes the globals used to identify interface methods defined
globals, so that they can (eventually) be left in the program for an
eventual non-LTO build mode.
This commit is contained in:
committed by
Ron Evans
parent
52d640967b
commit
f2e8d7112c
@@ -105,7 +105,7 @@ func OptimizeStringEqual(mod llvm.Module) {
|
||||
// As of this writing, the (reflect.Type).Interface method has not yet been
|
||||
// implemented so this optimization is critical for the encoding/json package.
|
||||
func OptimizeReflectImplements(mod llvm.Module) {
|
||||
implementsSignature := mod.NamedGlobal("func Implements(reflect.Type) bool")
|
||||
implementsSignature := mod.NamedGlobal("reflect/methods.Implements(reflect.Type) bool")
|
||||
if implementsSignature.IsNil() {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user