Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 261515dfe51c
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b28a87427417
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Aug 10, 2015

  1. Remove syscall builtin.

    whitequark committed Aug 10, 2015
    Copy the full SHA
    f53a5ff View commit details
  2. Inferencer: range() does not accept a float argument.

    whitequark committed Aug 10, 2015
    Copy the full SHA
    b28a874 View commit details
Showing with 9 additions and 16 deletions.
  1. +0 −3 artiq/compiler/builtins.py
  2. +0 −1 artiq/compiler/prelude.py
  3. +9 −12 artiq/compiler/transforms/inferencer.py
3 changes: 0 additions & 3 deletions artiq/compiler/builtins.py
Original file line number Diff line number Diff line change
@@ -150,9 +150,6 @@ def fn_print():
def fn_kernel():
return types.TBuiltinFunction("kernel")

def fn_syscall():
return types.TBuiltinFunction("syscall")

# Accessors

def is_none(typ):
1 change: 0 additions & 1 deletion artiq/compiler/prelude.py
Original file line number Diff line number Diff line change
@@ -20,5 +20,4 @@ def globals():
"round": builtins.fn_round(),
"print": builtins.fn_print(),
"kernel": builtins.fn_kernel(),
"syscall": builtins.fn_syscall(),
}
21 changes: 9 additions & 12 deletions artiq/compiler/transforms/inferencer.py
Original file line number Diff line number Diff line change
@@ -596,7 +596,7 @@ def makenotes(printer, typea, typeb, loca, locb):
self._unify(arg.type, range_tvar,
arg.loc, None)

if builtins.is_numeric(arg.type):
if builtins.is_int(arg.type):
pass
elif types.is_var(arg.type):
pass # undetermined yet
@@ -606,7 +606,7 @@ def makenotes(printer, typea, typeb, loca, locb):
{"type": types.TypePrinter().name(arg.type)},
arg.loc)
diag = diagnostic.Diagnostic("error",
"an argument of range() must be of a numeric type", {},
"an argument of range() must be of an integer type", {},
node.func.loc, notes=[note])
self.engine.process(diag)
else:
@@ -616,15 +616,16 @@ def makenotes(printer, typea, typeb, loca, locb):
valid_form("len(x:'a) -> int(width='b) where 'a is iterable"),
]

# TODO: should be ssize_t-sized
self._unify(node.type, builtins.TInt(types.TValue(32)),
node.loc, None)

if len(node.args) == 1 and len(node.keywords) == 0:
arg, = node.args

if builtins.is_iterable(arg.type):
pass
if builtins.is_range(arg.type):
self._unify(node.type, builtins.get_iterable_elt(arg.type),
node.loc, None)
elif builtins.is_list(arg.type):
# TODO: should be ssize_t-sized
self._unify(node.type, builtins.TInt(types.TValue(32)),
node.loc, None)
elif types.is_var(arg.type):
pass # undetermined yet
else:
@@ -666,10 +667,6 @@ def makenotes(printer, typea, typeb, loca, locb):
pass
else:
diagnose(valid_forms())
# TODO: add when it is clear what interface syscall() has
# elif types.is_builtin(typ, "syscall"):
# valid_Forms = lambda: [
# ]

def visit_CallT(self, node):
self.generic_visit(node)