forked from M-Labs/artiq
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:
parent
fd6d97f052
commit
a0a2650fca
|
@ -1812,7 +1812,8 @@ class ARTIQIRGenerator(algorithm.Visitor):
|
||||||
|
|
||||||
assert None not in args
|
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))
|
insn = self.append(ir.Call(func, args, arg_exprs))
|
||||||
else:
|
else:
|
||||||
after_invoke = self.add_block("invoke")
|
after_invoke = self.add_block("invoke")
|
||||||
|
|
Loading…
Reference in New Issue