mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.ssa] cmd/internal/gc: Generate code from ssa form
After the ssa compiler finishes, extract a cmd/internal/obj program from the result. Can compile and run iterative Fibonacci. The code is awful, but it runs. Change-Id: I19fa27ffe69863950a8cb594f33a5e9a671a7663 Reviewed-on: https://go-review.googlesource.com/9971 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
310d09bf73
commit
083a646f63
5 changed files with 291 additions and 24 deletions
|
|
@ -35,6 +35,12 @@ func stackalloc(f *Func) {
|
|||
if v.Type.IsMemory() { // TODO: only "regallocable" types
|
||||
continue
|
||||
}
|
||||
if v.Op == OpConst {
|
||||
// don't allocate space for OpConsts. They should
|
||||
// have been rematerialized everywhere.
|
||||
// TODO: is this the right thing to do?
|
||||
continue
|
||||
}
|
||||
// a := v.Type.Align()
|
||||
// n = (n + a - 1) / a * a TODO
|
||||
n += v.Type.Size()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue