ir: add descriptive error messages to SimpleDCE pass

This commit modifies the SimpleDCE pass to emit errors similar to those emitted by gc when the main function is missing.
This commit is contained in:
Jaden Weiss
2020-03-28 14:35:34 -04:00
committed by Ayke
parent 5cc130bb6e
commit 2501602b4f
2 changed files with 16 additions and 3 deletions
+4 -1
View File
@@ -237,7 +237,10 @@ func Compile(pkgName string, machine llvm.TargetMachine, config *compileopts.Con
c.ir = ir.NewProgram(lprogram, pkgName)
// Run a simple dead code elimination pass.
c.ir.SimpleDCE()
err = c.ir.SimpleDCE()
if err != nil {
return c.mod, nil, []error{err}
}
// Initialize debug information.
if c.Debug() {