forked from M-Labs/artiq
parent
052e400f12
commit
fab6e5cdff
|
@ -525,11 +525,10 @@ class LLVMIRGenerator:
|
||||||
print(typ)
|
print(typ)
|
||||||
assert False
|
assert False
|
||||||
|
|
||||||
if not (types.is_function(typ) or types.is_method(typ) or types.is_rpc(typ) or
|
if name == "__objectid__":
|
||||||
name == "__objectid__"):
|
|
||||||
rpctag = b"Os" + self._rpc_tag(typ, error_handler=rpc_tag_error) + b":n"
|
|
||||||
else:
|
|
||||||
rpctag = b""
|
rpctag = b""
|
||||||
|
else:
|
||||||
|
rpctag = b"Os" + self._rpc_tag(typ, error_handler=rpc_tag_error) + b":n"
|
||||||
|
|
||||||
llrpcattrinit = ll.Constant(llrpcattrty, [
|
llrpcattrinit = ll.Constant(llrpcattrty, [
|
||||||
ll.Constant(lli32, offset),
|
ll.Constant(lli32, offset),
|
||||||
|
@ -562,7 +561,10 @@ class LLVMIRGenerator:
|
||||||
offset += alignment - (offset % alignment)
|
offset += alignment - (offset % alignment)
|
||||||
|
|
||||||
if types.is_instance(typ) and attr not in typ.constant_attributes:
|
if types.is_instance(typ) and attr not in typ.constant_attributes:
|
||||||
|
try:
|
||||||
llrpcattrs.append(llrpcattr_of_attr(offset, attr, attrtyp))
|
llrpcattrs.append(llrpcattr_of_attr(offset, attr, attrtyp))
|
||||||
|
except ValueError:
|
||||||
|
continue
|
||||||
|
|
||||||
offset += size
|
offset += size
|
||||||
|
|
||||||
|
@ -1267,6 +1269,8 @@ class LLVMIRGenerator:
|
||||||
elif ir.is_keyword(typ):
|
elif ir.is_keyword(typ):
|
||||||
return b"k" + self._rpc_tag(typ.params["value"],
|
return b"k" + self._rpc_tag(typ.params["value"],
|
||||||
error_handler)
|
error_handler)
|
||||||
|
elif types.is_function(typ) or types.is_method(typ) or types.is_rpc(typ):
|
||||||
|
raise ValueError("RPC tag for functional value")
|
||||||
elif '__objectid__' in typ.attributes:
|
elif '__objectid__' in typ.attributes:
|
||||||
return b"O"
|
return b"O"
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
# RUN: %python -m artiq.compiler.testbench.embedding %s
|
||||||
|
|
||||||
|
from artiq.language.core import *
|
||||||
|
from artiq.language.types import *
|
||||||
|
|
||||||
|
@kernel
|
||||||
|
def a():
|
||||||
|
pass
|
||||||
|
|
||||||
|
fns = [a, a]
|
||||||
|
|
||||||
|
@kernel
|
||||||
|
def entrypoint():
|
||||||
|
fns[0]()
|
||||||
|
fns[1]()
|
Loading…
Reference in New Issue