compiler: do not use invoke for calls to nounwind ffi functions.

Otherwise, declarations such as:

  @syscall(flags={"nounwind", "nowrite"})
  def foo(...):

trip an LLVM assert because the invoke instruction and the !tbaa
metadata are no longer compatible since LLVM 4.0.
This commit is contained in:
whitequark 2017-12-26 16:24:57 +00:00
parent fd6d97f052
commit a0a2650fca
1 changed files with 2 additions and 1 deletions

View File

@ -1812,7 +1812,8 @@ class ARTIQIRGenerator(algorithm.Visitor):
assert None not in args
if self.unwind_target is None:
if self.unwind_target is None or \
types.is_function(callee.type) and "nounwind" in callee.type.flags:
insn = self.append(ir.Call(func, args, arg_exprs))
else:
after_invoke = self.add_block("invoke")