return reason
}
- // If fn is synthetic hash or eq function, cannot inline it.
- // The function is not generated in Unified IR frontend at this moment.
- if ir.IsEqOrHashFunc(fn) {
- reason = "type eq/hash function"
- return reason
- }
-
return ""
}
return objabi.PathToPrefix(pkg.Path) + "." + s.Name
}
-// IsEqOrHashFunc reports whether f is type eq/hash function.
-func IsEqOrHashFunc(f *Func) bool {
- if f == nil || f.Nname == nil {
- return false
- }
- return types.IsTypePkg(f.Sym().Pkg)
-}
-
var CurFunc *Func
// WithFunc invokes do with CurFunc and base.Pos set to curfn and
fn := typecheck.DeclFunc(sym, nil, args, results)
sym.Def = fn.Nname
+ fn.Pragma |= ir.Noinline // TODO(mdempsky): We need to emit this during the unified frontend instead, to allow inlining.
+
np := ir.AsNode(fn.Type().Params().Field(0).Nname)
nh := ir.AsNode(fn.Type().Params().Field(1).Nname)
[]*ir.Field{ir.NewField(base.Pos, typecheck.Lookup("r"), types.Types[types.TBOOL])},
)
sym.Def = fn.Nname
+ fn.Pragma |= ir.Noinline // TODO(mdempsky): We need to emit this during the unified frontend instead, to allow inlining.
+
np := ir.AsNode(fn.Type().Params().Field(0).Nname)
nq := ir.AsNode(fn.Type().Params().Field(1).Nname)
nr := ir.AsNode(fn.Type().Results().Field(0).Nname)
return p.Path == "reflect"
}
-// IsTypePkg reports whether p is pesudo package type.
-func IsTypePkg(p *Pkg) bool {
- return p == typepkg
-}
-
// IsNoInstrumentPkg reports whether p is a package that
// should not be instrumented.
func IsNoInstrumentPkg(p *Pkg) bool {