Make note about preverifier bug in LLVM that *.verify() will abort upon error

This commit is contained in:
Siu Kwan Lam 2013-01-10 17:13:06 -06:00
commit 207254fe50

View file

@ -522,6 +522,8 @@ class Module(llvm.Ownable, llvm.Cacheable):
Checks module for errors. Raises `llvm.LLVMException' on any
error."""
ret = _core.LLVMVerifyModule(self.ptr)
# Note: LLVM has a bug in preverifier that will always abort
# the process upon failure.
if ret != "":
raise llvm.LLVMException(ret)
@ -1508,6 +1510,9 @@ class Function(GlobalValue):
def verify(self):
# Although we're just asking LLVM to return the success or
# failure, it appears to print result to stderr and abort.
# Note: LLVM has a bug in preverifier that will always abort
# the process upon failure.
return _core.LLVMVerifyFunction(self.ptr) != 0
#===----------------------------------------------------------------------===