File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -117,8 +117,9 @@ func OptimizeStringEqual(mod llvm.Module) {
117117// As of this writing, the (reflect.Type).Interface method has not yet been
118118// implemented so this optimization is critical for the encoding/json package.
119119func OptimizeReflectImplements (mod llvm.Module ) {
120- implementsSignature := mod .NamedGlobal ("reflect/methods.Implements(reflect.Type) bool" )
121- if implementsSignature .IsNil () {
120+ implementsSignature1 := mod .NamedGlobal ("reflect/methods.Implements(reflect.Type) bool" )
121+ implementsSignature2 := mod .NamedGlobal ("reflect/methods.Implements(internal/reflectlite.Type) bool" )
122+ if implementsSignature1 .IsNil () && implementsSignature2 .IsNil () {
122123 return
123124 }
124125
@@ -132,7 +133,8 @@ func OptimizeReflectImplements(mod llvm.Module) {
132133 if attr .IsNil () {
133134 continue
134135 }
135- if attr .GetStringValue () == "reflect/methods.Implements(reflect.Type) bool" {
136+ val := attr .GetStringValue ()
137+ if val == "reflect/methods.Implements(reflect.Type) bool" || val == "reflect/methods.Implements(internal/reflectlite.Type) bool" {
136138 implementsFunc = fn
137139 break
138140 }
You can’t perform that action at this time.
0 commit comments