Browse Source

Resolve import cycles.

pull/3/head
Jakob Stoklund Olesen 8 years ago
parent
commit
1e1830aaa6
  1. 8
      lib/cretonne/meta/cretonne/ast.py
  2. 6
      lib/cretonne/meta/cretonne/typevar.py

8
lib/cretonne/meta/cretonne/ast.py

@ -5,7 +5,7 @@ This module defines classes that can be used to create abstract syntax trees
for patern matching an rewriting of cretonne instructions.
"""
from __future__ import absolute_import
from . import Instruction, BoundInstruction
import cretonne
try:
from typing import Union, Tuple # noqa
@ -174,12 +174,12 @@ class Apply(Expr):
"""
def __init__(self, inst, args):
# type: (Union[Instruction, BoundInstruction], Tuple[Expr, ...]) -> None # noqa
if isinstance(inst, BoundInstruction):
# type: (Union[cretonne.Instruction, cretonne.BoundInstruction], Tuple[Expr, ...]) -> None # noqa
if isinstance(inst, cretonne.BoundInstruction):
self.inst = inst.inst
self.typevars = inst.typevars
else:
assert isinstance(inst, Instruction)
assert isinstance(inst, cretonne.Instruction)
self.inst = inst
self.typevars = ()
self.args = args

6
lib/cretonne/meta/cretonne/typevar.py

@ -6,7 +6,7 @@ polymorphic by using type variables.
"""
from __future__ import absolute_import
import math
from . import OperandKind, value # noqa
import cretonne
try:
from typing import Tuple, Union # noqa
@ -315,11 +315,11 @@ class TypeVar(object):
return TypeVar(None, None, base=self, derived_func='DoubleWidth')
def operand_kind(self):
# type: () -> OperandKind
# type: () -> cretonne.OperandKind
# When a `TypeVar` object is used to describe the type of an `Operand`
# in an instruction definition, the kind of that operand is an SSA
# value.
return value # type: ignore
return cretonne.value # type: ignore
def free_typevar(self):
# type: () -> TypeVar

Loading…
Cancel
Save