}
}
-func doversion() {
- p := objabi.Expstring()
- if p == objabi.DefaultExpstring() {
- p = ""
- }
- sep := ""
- if p != "" {
- sep = " "
- }
- fmt.Printf("compile version %s%s%s\n", objabi.Version, sep, p)
- os.Exit(0)
-}
-
// supportsDynlink reports whether or not the code generator for the given
// architecture supports the -shared and -dynlink flags.
func supportsDynlink(arch *sys.Arch) bool {
return n.Op == OINDREGSP
}
-func isstack(n *Node) bool {
- n = outervalue(n)
-
- // If n is *autotmp and autotmp = &foo, replace n with foo.
- // We introduce such temps when initializing struct literals.
- if n.Op == OIND && n.Left.Op == ONAME && n.Left.IsAutoTmp() {
- defn := n.Left.Name.Defn
- if defn != nil && defn.Op == OAS && defn.Right.Op == OADDR {
- n = defn.Right.Left
- }
- }
-
- switch n.Op {
- case OINDREGSP:
- return true
-
- case ONAME:
- switch n.Class() {
- case PAUTO, PPARAM, PPARAMOUT:
- return true
- }
- }
-
- return false
-}
-
// isReflectHeaderDataField reports whether l is an expression p.Data
// where p has type reflect.SliceHeader or reflect.StringHeader.
func isReflectHeaderDataField(l *Node) bool {
return t.IsSigned()
}
-func typeSize(t *types.Type) int64 {
- return t.Size()
-}
-
// mergeSym merges two symbolic offsets. There is no real merging of
// offsets, we just pick the non-nil one.
func mergeSym(x, y interface{}) interface{} {