compiler: do not abort on verification failure

Этот коммит содержится в:
Ayke van Laethem 2018-11-03 18:24:57 +01:00
родитель 22914165cc
коммит 60eefe1568
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: E97FF5335DFDFDED
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -3536,7 +3536,7 @@ func (c *Compiler) IR() string {
} }
func (c *Compiler) Verify() error { func (c *Compiler) Verify() error {
return llvm.VerifyModule(c.mod, 0) return llvm.VerifyModule(c.mod, llvm.PrintMessageAction)
} }
func (c *Compiler) ApplyFunctionSections() { func (c *Compiler) ApplyFunctionSections() {

Просмотреть файл

@ -70,7 +70,9 @@ func Compile(pkgName, outpath string, spec *TargetSpec, config *BuildConfig, act
// stack-allocated values. // stack-allocated values.
if strings.HasPrefix(spec.Triple, "wasm") { if strings.HasPrefix(spec.Triple, "wasm") {
c.ExternalInt64AsPtr() c.ExternalInt64AsPtr()
c.Verify() if err := c.Verify(); err != nil {
return err
}
} }
// Optimization levels here are roughly the same as Clang, but probably not // Optimization levels here are roughly the same as Clang, but probably not