mirror of https://github.com/golang/go.git
cmd/compile: allow objStub from unsafe package
CL 346469 added support for unsafe.Sizeof and friends to operate on generic parameters for compiler importer/exporter. This CL adds support for unified IR. Updates #48094 Change-Id: I63af1a7c3478f59b03ecc23229ac2254d3457868 Reviewed-on: https://go-review.googlesource.com/c/go/+/346769 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
1bd35fab05
commit
9afbf82667
|
|
@ -147,6 +147,10 @@ func (r *reader2) doPkg() *types2.Package {
|
||||||
if path == "builtin" {
|
if path == "builtin" {
|
||||||
return nil // universe
|
return nil // universe
|
||||||
}
|
}
|
||||||
|
if path == "unsafe" {
|
||||||
|
// TODO(mdempsky): This should be in r.p.imports.
|
||||||
|
return types2.Unsafe
|
||||||
|
}
|
||||||
if path == "" {
|
if path == "" {
|
||||||
path = r.p.pkgPath
|
path = r.p.pkgPath
|
||||||
}
|
}
|
||||||
|
|
@ -362,7 +366,7 @@ func (pr *pkgReader2) objIdx(idx int) (*types2.Package, string) {
|
||||||
tag := codeObj(rname.code(syncCodeObj))
|
tag := codeObj(rname.code(syncCodeObj))
|
||||||
|
|
||||||
if tag == objStub {
|
if tag == objStub {
|
||||||
assert(objPkg == nil)
|
assert(objPkg == nil || objPkg == types2.Unsafe)
|
||||||
return objPkg, objName
|
return objPkg, objName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue