forked from M-Labs/artiq
parent
fcd12e3472
commit
ce3c8fcd3e
|
@ -410,7 +410,13 @@ class BasicBlock(NamedValue):
|
|||
class Argument(NamedValue):
|
||||
"""
|
||||
A function argument.
|
||||
|
||||
:ivar loc: (:class:`pythonparser.source.Range` or None)
|
||||
source location
|
||||
"""
|
||||
def __init__(self, typ, name):
|
||||
super().__init__(typ, name)
|
||||
self.loc = None
|
||||
|
||||
def as_entity(self, type_printer):
|
||||
return self.as_operand(type_printer)
|
||||
|
|
|
@ -268,6 +268,9 @@ class ARTIQIRGenerator(algorithm.Visitor):
|
|||
self.current_args[arg_name] = arg
|
||||
optargs.append(arg)
|
||||
|
||||
for (arg, arg_node) in zip(args + optargs, node.args.args):
|
||||
arg.loc = arg_node.loc
|
||||
|
||||
func = ir.Function(typ, ".".join(self.name), [env_arg] + args + optargs,
|
||||
loc=node.lambda_loc if is_lambda else node.keyword_loc)
|
||||
func.is_internal = is_internal
|
||||
|
|
Loading…
Reference in New Issue