compiler: refactor alloca/lifetime/wordpack code into separate package

This code is required by transformation passes which are being moved
into a separate package, but is too complicated to simply copy.
Therefore, I decided to move them into a new package.
This commit is contained in:
Ayke van Laethem
2019-11-13 18:08:24 +01:00
committed by Ayke
parent 009b27350e
commit 36d1198115
10 changed files with 264 additions and 197 deletions
-15
View File
@@ -11,21 +11,6 @@ import (
"tinygo.org/x/go-llvm"
)
// needsStackObjects returns true if the compiler should insert stack objects
// that can be traced by the garbage collector.
func (c *Compiler) needsStackObjects() bool {
if c.GC() != "conservative" {
return false
}
for _, tag := range c.BuildTags() {
if tag == "baremetal" {
return false
}
}
return true
}
// trackExpr inserts pointer tracking intrinsics for the GC if the expression is
// one of the expressions that need this.
func (c *Compiler) trackExpr(frame *Frame, expr ssa.Value, value llvm.Value) {