]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/walk/order.go
cmd/compile/internal/staticinit: make staticopy safe
[gostls13.git] / src / cmd / compile / internal / walk / order.go
index c2ed528f330284c0d36004349505ac3fb04053c7..0cd050c3ea9e77818cdf17ee07094bb14de9f9f9 100644 (file)
@@ -538,7 +538,7 @@ func (o *orderState) call(nn ir.Node) {
        n := nn.(*ir.CallExpr)
        typecheck.AssertFixedCall(n)
 
-       if isFuncPCIntrinsic(n) && isIfaceOfFunc(n.Args[0]) {
+       if ir.IsFuncPCIntrinsic(n) && isIfaceOfFunc(n.Args[0]) {
                // For internal/abi.FuncPCABIxxx(fn), if fn is a defined function,
                // do not introduce temporaries here, so it is easier to rewrite it
                // to symbol address reference later in walk.
@@ -1500,16 +1500,6 @@ func (o *orderState) as2ok(n *ir.AssignListStmt) {
        o.stmt(typecheck.Stmt(as))
 }
 
-// isFuncPCIntrinsic returns whether n is a direct call of internal/abi.FuncPCABIxxx functions.
-func isFuncPCIntrinsic(n *ir.CallExpr) bool {
-       if n.Op() != ir.OCALLFUNC || n.X.Op() != ir.ONAME {
-               return false
-       }
-       fn := n.X.(*ir.Name).Sym()
-       return (fn.Name == "FuncPCABI0" || fn.Name == "FuncPCABIInternal") &&
-               fn.Pkg.Path == "internal/abi"
-}
-
 // isIfaceOfFunc returns whether n is an interface conversion from a direct reference of a func.
 func isIfaceOfFunc(n ir.Node) bool {
        return n.Op() == ir.OCONVIFACE && n.(*ir.ConvExpr).X.Op() == ir.ONAME && n.(*ir.ConvExpr).X.(*ir.Name).Class == ir.PFUNC