aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/typecheck/iimport.go
diff options
context:
space:
mode:
authorDan Scales <danscales@google.com>2021-05-10 10:17:51 -0700
committerDan Scales <danscales@google.com>2021-05-21 17:14:19 +0000
commitb1a398cf0f04ac911be204d3c0ee001a94621683 (patch)
tree46dc3881562f151d261423b87b60f19ef51c816f /src/cmd/compile/internal/typecheck/iimport.go
parentccbfbb1c3327fffe88dd6b6da550f4a0cd37db6e (diff)
downloadgo-b1a398cf0f04ac911be204d3c0ee001a94621683.tar.gz
go-b1a398cf0f04ac911be204d3c0ee001a94621683.zip
[dev.typeparams] cmd/compile: add import/export of calls to builtin functions
For generic functions, we have to leave the builtins in OCALL form, rather than transform to specific ops, since we don't know the exact types involved. Allow export/import of builtins in OCALL form. Added new export/import test mapimp.go. Change-Id: I571f8eeaa13b4f69389dbdb9afb6cc61924b9bf2 Reviewed-on: https://go-review.googlesource.com/c/go/+/321750 Trust: Dan Scales <danscales@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/iimport.go')
-rw-r--r--src/cmd/compile/internal/typecheck/iimport.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/typecheck/iimport.go b/src/cmd/compile/internal/typecheck/iimport.go
index 3b725a226c..39b5ab09da 100644
--- a/src/cmd/compile/internal/typecheck/iimport.go
+++ b/src/cmd/compile/internal/typecheck/iimport.go
@@ -1184,6 +1184,10 @@ func (r *importReader) node() ir.Node {
return n
case ir.ONAME:
+ isBuiltin := r.bool()
+ if isBuiltin {
+ return types.BuiltinPkg.Lookup(r.string()).Def.(*ir.Name)
+ }
return r.localName()
// case OPACK, ONONAME: