github.com/epfl-dcsl/gotee@v0.0.0-20200909122901-014b35f5e5e9/src/reflect/gosec.go (about)

     1  package reflect
     2  
     3  import (
     4  	r "runtime"
     5  	u "unsafe"
     6  )
     7  
     8  func ConvTypePtr(tpe *r.DPTpe) Type {
     9  	rtpe := (*rtype)(u.Pointer(tpe))
    10  	return PtrTo(rtpe)
    11  }
    12  
    13  func ConvTypeToDPTpe(tpe Type) *r.DPTpe {
    14  	ptr := ValueOf(tpe).Pointer()
    15  	return (*r.DPTpe)(u.Pointer(ptr))
    16  }
    17  
    18  func ConvDPTpeToType(tpe *r.DPTpe) Type {
    19  	rtpe := (*rtype)(u.Pointer(tpe))
    20  	return rtpe
    21  }