From 7c833f07270bac6c02cab16a65e17c2a9bcd810a Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 2 Jul 2015 21:54:31 +0300 Subject: [PATCH] Move transforms.MonomorphismChecker to validators.MonomorphismValidator. --- artiq/compiler/module.py | 6 +++--- artiq/compiler/transforms/__init__.py | 1 - artiq/compiler/validators/__init__.py | 1 + .../monomorphism_checker.py => validators/monomorphism.py} | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 artiq/compiler/validators/__init__.py rename artiq/compiler/{transforms/monomorphism_checker.py => validators/monomorphism.py} (91%) diff --git a/artiq/compiler/module.py b/artiq/compiler/module.py index 15db5b368..7b5e67bf5 100644 --- a/artiq/compiler/module.py +++ b/artiq/compiler/module.py @@ -4,7 +4,7 @@ The :class:`Module` class encapsulates a single Python import os from pythonparser import source, diagnostic, parse_buffer -from . import prelude, types, transforms +from . import prelude, types, transforms, validators class Module: def __init__(self, source_buffer, engine=None): @@ -14,14 +14,14 @@ class Module: asttyped_rewriter = transforms.ASTTypedRewriter(engine=engine) inferencer = transforms.Inferencer(engine=engine) int_monomorphizer = transforms.IntMonomorphizer(engine=engine) - monomorphism_checker = transforms.MonomorphismChecker(engine=engine) + monomorphism_validator = validators.MonomorphismValidator(engine=engine) parsetree, comments = parse_buffer(source_buffer, engine=engine) typedtree = asttyped_rewriter.visit(parsetree) inferencer.visit(typedtree) int_monomorphizer.visit(typedtree) inferencer.visit(typedtree) - monomorphism_checker.visit(typedtree) + monomorphism_validator.visit(typedtree) self.name = os.path.basename(source_buffer.name) self.globals = asttyped_rewriter.globals diff --git a/artiq/compiler/transforms/__init__.py b/artiq/compiler/transforms/__init__.py index ed45a42f8..795c14c79 100644 --- a/artiq/compiler/transforms/__init__.py +++ b/artiq/compiler/transforms/__init__.py @@ -1,4 +1,3 @@ from .asttyped_rewriter import ASTTypedRewriter from .inferencer import Inferencer from .int_monomorphizer import IntMonomorphizer -from .monomorphism_checker import MonomorphismChecker diff --git a/artiq/compiler/validators/__init__.py b/artiq/compiler/validators/__init__.py new file mode 100644 index 000000000..d2ec51350 --- /dev/null +++ b/artiq/compiler/validators/__init__.py @@ -0,0 +1 @@ +from .monomorphism import MonomorphismValidator diff --git a/artiq/compiler/transforms/monomorphism_checker.py b/artiq/compiler/validators/monomorphism.py similarity index 91% rename from artiq/compiler/transforms/monomorphism_checker.py rename to artiq/compiler/validators/monomorphism.py index b777c9082..e4dd1d853 100644 --- a/artiq/compiler/transforms/monomorphism_checker.py +++ b/artiq/compiler/validators/monomorphism.py @@ -1,12 +1,12 @@ """ -:class:`MonomorphismChecker` verifies that all type variables have been +:class:`MonomorphismValidator` verifies that all type variables have been elided, which is necessary for code generation. """ from pythonparser import algorithm, diagnostic from .. import asttyped, types, builtins -class MonomorphismChecker(algorithm.Visitor): +class MonomorphismValidator(algorithm.Visitor): def __init__(self, engine): self.engine = engine