compiler: do not abort on verification failure

This commit is contained in:
Ayke van Laethem
2018-11-03 18:24:57 +01:00
parent 22914165cc
commit 60eefe1568
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -3536,7 +3536,7 @@ func (c *Compiler) IR() string {
}
func (c *Compiler) Verify() error {
return llvm.VerifyModule(c.mod, 0)
return llvm.VerifyModule(c.mod, llvm.PrintMessageAction)
}
func (c *Compiler) ApplyFunctionSections() {
+3 -1
View File
@@ -70,7 +70,9 @@ func Compile(pkgName, outpath string, spec *TargetSpec, config *BuildConfig, act
// stack-allocated values.
if strings.HasPrefix(spec.Triple, "wasm") {
c.ExternalInt64AsPtr()
c.Verify()
if err := c.Verify(); err != nil {
return err
}
}
// Optimization levels here are roughly the same as Clang, but probably not