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
@@ -77,6 +77,21 @@ func (c *Config) GC() string {
return "conservative"
}
// NeedsStackObjects returns true if the compiler should insert stack objects
// that can be traced by the garbage collector.
func (c *Config) NeedsStackObjects() bool {
if c.GC() != "conservative" {
return false
}
for _, tag := range c.BuildTags() {
if tag == "baremetal" {
return false
}
}
return true
}
// Scheduler returns the scheduler implementation. Valid values are "coroutines"
// and "tasks".
func (c *Config) Scheduler() string {