compiler: move IR checker to separate package

This is a preparation for moving the Optimize function to the transform
package.
This commit is contained in:
Ayke van Laethem
2020-03-18 17:38:24 +01:00
committed by Ron Evans
parent 599670cef6
commit 2f88c7aab4
3 changed files with 74 additions and 21 deletions
+3 -2
View File
@@ -3,6 +3,7 @@ package compiler
import (
"errors"
"github.com/tinygo-org/tinygo/compiler/ircheck"
"github.com/tinygo-org/tinygo/transform"
"tinygo.org/x/go-llvm"
)
@@ -25,7 +26,7 @@ func (c *Compiler) Optimize(optLevel, sizeLevel int, inlinerThreshold uint) []er
// run a check of all of our code
if c.VerifyIR() {
errs := c.checkModule()
errs := ircheck.Module(c.mod)
if errs != nil {
return errs
}
@@ -131,7 +132,7 @@ func (c *Compiler) Optimize(optLevel, sizeLevel int, inlinerThreshold uint) []er
}
if c.VerifyIR() {
if errs := c.checkModule(); errs != nil {
if errs := ircheck.Module(c.mod); errs != nil {
return errs
}
}