mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 21:13:39 +00:00
compiler: move funcImplementation to compileopts
This allows packages other than the compiler to know (from a single source of truth) which implemenation is used for Go func values. This refactor is necessary to be able to move the Optimize function to the transform package.
This commit is contained in:
committed by
Ron Evans
parent
2f88c7aab4
commit
78bd7e094f
@@ -3,6 +3,7 @@ package compiler
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/tinygo-org/tinygo/compileopts"
|
||||
"github.com/tinygo-org/tinygo/compiler/ircheck"
|
||||
"github.com/tinygo-org/tinygo/transform"
|
||||
"tinygo.org/x/go-llvm"
|
||||
@@ -67,7 +68,7 @@ func (c *Compiler) Optimize(optLevel, sizeLevel int, inlinerThreshold uint) []er
|
||||
return errs
|
||||
}
|
||||
|
||||
if c.funcImplementation() == funcValueSwitch {
|
||||
if c.FuncImplementation() == compileopts.FuncValueSwitch {
|
||||
transform.LowerFuncValues(c.mod)
|
||||
}
|
||||
|
||||
@@ -99,7 +100,7 @@ func (c *Compiler) Optimize(optLevel, sizeLevel int, inlinerThreshold uint) []er
|
||||
} else {
|
||||
// Must be run at any optimization level.
|
||||
transform.LowerInterfaces(c.mod)
|
||||
if c.funcImplementation() == funcValueSwitch {
|
||||
if c.FuncImplementation() == compileopts.FuncValueSwitch {
|
||||
transform.LowerFuncValues(c.mod)
|
||||
}
|
||||
errs := transform.LowerInterrupts(c.mod)
|
||||
|
||||
Reference in New Issue
Block a user