Print IR before optimization

This makes invalid IR easier to spot (see previous commit).
This commit is contained in:
Ayke van Laethem
2018-04-13 20:30:45 +02:00
parent 01ee0c456c
commit 6607cff14e
+4 -4
View File
@@ -424,6 +424,10 @@ func Compile(inpath, outpath, target string, printIR bool) error {
return err
}
if printIR {
fmt.Println(c.IR())
}
if err := c.Verify(); err != nil {
return err
}
@@ -432,10 +436,6 @@ func Compile(inpath, outpath, target string, printIR bool) error {
return err
}
if printIR {
fmt.Println(c.IR())
}
err = c.EmitObject(outpath)
if err != nil {
return err