From 9e0a5b940494a5708b69bc8a4cd95803be03ad70 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 17 Nov 2015 01:00:10 +0300 Subject: [PATCH] transforms.iodelay_estimator: skip statements, not modules on _UnknownDelay. --- artiq/compiler/transforms/iodelay_estimator.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/artiq/compiler/transforms/iodelay_estimator.py b/artiq/compiler/transforms/iodelay_estimator.py index f8c190fb4..aaae55676 100644 --- a/artiq/compiler/transforms/iodelay_estimator.py +++ b/artiq/compiler/transforms/iodelay_estimator.py @@ -80,8 +80,12 @@ class IODelayEstimator(algorithm.Visitor): 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):