mirror of https://github.com/m-labs/artiq.git
transforms.llvm_ir_generator: ignore assignments of None (fixes #309).
This commit is contained in:
parent
c7d48a1765
commit
7e16da4a77
|
@ -655,8 +655,11 @@ class LLVMIRGenerator:
|
||||||
|
|
||||||
def process_SetLocal(self, insn):
|
def process_SetLocal(self, insn):
|
||||||
env = insn.environment()
|
env = insn.environment()
|
||||||
llptr = self.llptr_to_var(self.map(env), env.type, insn.var_name)
|
|
||||||
llvalue = self.map(insn.value())
|
llvalue = self.map(insn.value())
|
||||||
|
if isinstance(llvalue.type, ll.VoidType):
|
||||||
|
# We store NoneType as {} but return it as void. So, bail out here.
|
||||||
|
return ll.Constant(ll.LiteralStructType([]), [])
|
||||||
|
llptr = self.llptr_to_var(self.map(env), env.type, insn.var_name)
|
||||||
if isinstance(llvalue, ll.Block):
|
if isinstance(llvalue, ll.Block):
|
||||||
llvalue = ll.BlockAddress(self.llfunction, llvalue)
|
llvalue = ll.BlockAddress(self.llfunction, llvalue)
|
||||||
if llptr.type.pointee != llvalue.type:
|
if llptr.type.pointee != llvalue.type:
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
# RUN: %python -m artiq.compiler.testbench.llvmgen %s
|
||||||
|
|
||||||
|
def f():
|
||||||
|
pass
|
||||||
|
def g():
|
||||||
|
a = f()
|
Loading…
Reference in New Issue