]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/ir/func.go
cmd/compile/internal/staticinit: make staticopy safe
[gostls13.git] / src / cmd / compile / internal / ir / func.go
index 952f6fb92978953560203ec23518a511990b1f39..e28bbbd577c31ce5c47a0b3f318a64b0bd0bcf8a 100644 (file)
@@ -445,3 +445,13 @@ func NewClosureFunc(fpos, cpos src.XPos, why Op, typ *types.Type, outerfn *Func,
 
        return fn
 }
+
+// IsFuncPCIntrinsic returns whether n is a direct call of internal/abi.FuncPCABIxxx functions.
+func IsFuncPCIntrinsic(n *CallExpr) bool {
+       if n.Op() != OCALLFUNC || n.X.Op() != ONAME {
+               return false
+       }
+       fn := n.X.(*Name).Sym()
+       return (fn.Name == "FuncPCABI0" || fn.Name == "FuncPCABIInternal") &&
+               fn.Pkg.Path == "internal/abi"
+}