package gc
import (
+ "cmd/compile/internal/ssa"
"cmd/internal/obj"
"crypto/md5"
"fmt"
var nam *Node
var gcargs *Sym
var gclocals *Sym
+ var ssafn *ssa.Func
+ var usessa bool
if fn.Nbody == nil {
if pure_go != 0 || strings.HasPrefix(fn.Func.Nname.Sym.Name, "init.") {
Yyerror("missing function body for %q", fn.Func.Nname.Sym.Name)
goto ret
}
+ // Build an SSA backend function.
+ // TODO: get rid of usessa.
+ ssafn, usessa = buildssa(Curfn)
+
continpc = nil
breakpc = nil
nam = nil
}
ptxt = Thearch.Gins(obj.ATEXT, nam, &nod1)
+ Afunclit(&ptxt.From, Curfn.Func.Nname)
ptxt.From3 = new(obj.Addr)
if fn.Func.Dupok {
ptxt.From3.Offset |= obj.DUPOK
if fn.Func.Nosplit {
ptxt.From3.Offset |= obj.NOSPLIT
}
+ if fn.Func.Systemstack {
+ ptxt.From.Sym.Cfunc = 1
+ }
// Clumsy but important.
// See test/recover.go for test cases and src/reflect/value.go
}
}
- Afunclit(&ptxt.From, Curfn.Func.Nname)
-
ginit()
gcargs = makefuncdatasym("gcargs·%d", obj.FUNCDATA_ArgsPointerMaps)
}
}
+ if ssafn != nil && usessa {
+ genssa(ssafn, ptxt, gcargs, gclocals)
+ return
+ }
Genlist(Curfn.Func.Enter)
Genlist(Curfn.Nbody)
gclean()