s.f.Config = ssaConfig
s.f.Cache = &ssaCaches[worker]
s.f.Cache.Reset()
- s.f.DebugTest = s.f.DebugHashMatch("GOSSAHASH", name)
s.f.Name = name
+ s.f.DebugTest = s.f.DebugHashMatch("GOSSAHASH")
s.f.PrintOrHtmlSSA = printssa
if fn.Func.Pragma&Nosplit != 0 {
s.f.NoSplit = true
e.curfn.Func.setWBPos(pos)
}
+func (e *ssafn) MyImportPath() string {
+ return myimportpath
+}
+
func (n *Node) Typ() *types.Type {
return n.Type
}
// SetWBPos indicates that a write barrier has been inserted
// in this function at position pos.
SetWBPos(pos src.XPos)
+
+ // MyImportPath provides the import name (roughly, the package) for the function being compiled.
+ MyImportPath() string
}
// interface used to hold a *gc.Node (a stack variable).
func (d DummyFrontend) Warnl(_ src.XPos, msg string, args ...interface{}) { d.t.Logf(msg, args...) }
func (d DummyFrontend) Debug_checknil() bool { return false }
+func (d DummyFrontend) MyImportPath() string {
+ return "my/import/path"
+}
+
var dummyTypes Types
func init() {
// GSHS_LOGFILE
// or standard out if that is empty or there is an error
// opening the file.
-func (f *Func) DebugHashMatch(evname, name string) bool {
+func (f *Func) DebugHashMatch(evname string) bool {
+ name := f.fe.MyImportPath() + "." + f.Name
evhash := os.Getenv(evname)
switch evhash {
case "":
file = os.Stdout
if tmpfile := os.Getenv("GSHS_LOGFILE"); tmpfile != "" {
var err error
- file, err = os.Create(tmpfile)
+ file, err = os.OpenFile(tmpfile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil {
f.Fatalf("could not open hash-testing logfile %s", tmpfile)
}