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: a2d73c8b05c4
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: 9e0a5b940494
Choose a head ref
  • 4 commits
  • 2 files changed
  • 1 contributor

Commits on Nov 16, 2015

  1. compiler.iodelay: fix typo in Var.__eq__.

    whitequark committed Nov 16, 2015
    Copy the full SHA
    841e01a View commit details
  2. Copy the full SHA
    10f82ff View commit details
  3. Copy the full SHA
    44d0a35 View commit details
  4. transforms.iodelay_estimator: skip statements, not modules on _Unknow…

    …nDelay.
    whitequark committed Nov 16, 2015
    Copy the full SHA
    9e0a5b9 View commit details
Showing with 16 additions and 3 deletions.
  1. +1 −1 artiq/compiler/iodelay.py
  2. +15 −2 artiq/compiler/transforms/iodelay_estimator.py
2 changes: 1 addition & 1 deletion artiq/compiler/iodelay.py
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ def __str__(self):
return self.name

def __eq__(lhs, rhs):
return rhs.__class__ == lhs.__class__ and lhs.value == rhs.value
return rhs.__class__ == lhs.__class__ and lhs.name == rhs.name

def free_vars(self):
return {self.name}
17 changes: 15 additions & 2 deletions artiq/compiler/transforms/iodelay_estimator.py
Original file line number Diff line number Diff line change
@@ -80,8 +80,12 @@ def visit_fixpoint(self, node):

def visit_ModuleT(self, node):
try:
self.visit(node.body)
except (diagnostic.Error, _UnknownDelay):
for stmt in node.body:
try:
self.visit(stmt)
except _UnknownDelay:
pass # more luck next time?
except diagnostic.Error:
pass # we don't care; module-level code is never interleaved

def visit_function(self, args, body, typ, loc):
@@ -101,8 +105,17 @@ def visit_function(self, args, body, typ, loc):
self.current_return = old_return
self.current_args = old_args

if types.is_indeterminate_delay(delay) and types.is_indeterminate_delay(typ.delay):
# Both delays indeterminate; no point in unifying since that will
# replace the lazy and more specific error with an eager and more generic
# error (unification error of delay(?) with delay(?), which is useless).
return

try:
old_delay = typ.delay.find()
typ.delay.unify(delay)
if typ.delay.find() != old_delay:
self.changed = True
except types.UnificationError as e:
printer = types.TypePrinter()
diag = diagnostic.Diagnostic("fatal",