compiler: move GC passes to the transform package

This commit is contained in:
Ayke van Laethem
2019-11-17 20:37:45 +01:00
committed by Ron Evans
parent 3d3e48179e
commit f0bb3c092d
9 changed files with 611 additions and 359 deletions
+2 -2
View File
@@ -137,8 +137,8 @@ func (c *Compiler) Optimize(optLevel, sizeLevel int, inlinerThreshold uint) erro
builder.Populate(modPasses)
modPasses.Run(c.mod)
hasGCPass := c.addGlobalsBitmap()
hasGCPass = c.makeGCStackSlots() || hasGCPass
hasGCPass := transform.AddGlobalsBitmap(c.mod)
hasGCPass = transform.MakeGCStackSlots(c.mod) || hasGCPass
if hasGCPass {
if err := c.Verify(); err != nil {
return errors.New("GC pass caused a verification failure")