PR tree-optimization/82929
[official-gcc.git] / libgo / go / reflect / export_test.go
blob92b13025380372ddfedc5cc575b72aafd68ac66d
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 package reflect
7 // MakeRO returns a copy of v with the read-only flag set.
8 func MakeRO(v Value) Value {
9 v.flag |= flagStickyRO
10 return v
13 // IsRO reports whether v's read-only flag is set.
14 func IsRO(v Value) bool {
15 return v.flag&flagStickyRO != 0
18 var CallGC = &callGC
20 const PtrSize = ptrSize
22 func FuncLayout(t Type, rcvr Type) (frametype Type, argSize, retOffset uintptr, stack []byte, gc []byte, ptrs bool) {
23 return
26 func TypeLinks() []string {
27 return nil
30 var GCBits = gcbits
32 // Will be provided by runtime eventually.
33 func gcbits(interface{}) []byte {
34 return nil
37 func MapBucketOf(x, y Type) Type {
38 return nil
41 func CachedBucketOf(m Type) Type {
42 return nil
45 type EmbedWithUnexpMeth struct{}
47 func (EmbedWithUnexpMeth) f() {}
49 type pinUnexpMeth interface {
50 f()
53 var pinUnexpMethI = pinUnexpMeth(EmbedWithUnexpMeth{})
56 func FirstMethodNameBytes(t Type) *byte {
57 _ = pinUnexpMethI
59 ut := t.uncommon()
60 if ut == nil {
61 panic("type has no methods")
63 m := ut.methods()[0]
64 mname := t.(*rtype).nameOff(m.name)
65 if *mname.data(0)&(1<<2) == 0 {
66 panic("method name does not have pkgPath *string")
68 return mname.bytes
72 type OtherPkgFields struct {
73 OtherExported int
74 otherUnexported int
77 func IsExported(t Type) bool {
78 return t.PkgPath() == ""
82 func ResolveReflectName(s string) {
83 resolveReflectName(newName(s, "", "", false))
87 type Buffer struct {
88 buf []byte