Get rid of operand_kind()
This method caused lots of import cycles when type checking. Use isinstance() in the Operand constructor instead to decipher the OperandSpec union type.
This commit is contained in:
@@ -32,14 +32,6 @@ class OperandKind(object):
|
||||
# type: () -> str
|
||||
return 'OperandKind({})'.format(self.name)
|
||||
|
||||
def operand_kind(self):
|
||||
# type: () -> OperandKind
|
||||
"""
|
||||
An `OperandKind` instance can be used directly as the type of an
|
||||
`Operand` when defining an instruction.
|
||||
"""
|
||||
return self
|
||||
|
||||
def free_typevar(self):
|
||||
# Return the free typevariable controlling the type of this operand.
|
||||
return None
|
||||
|
||||
@@ -6,7 +6,6 @@ polymorphic by using type variables.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
import math
|
||||
import cdsl.operands
|
||||
|
||||
try:
|
||||
from typing import Tuple, Union # noqa
|
||||
@@ -314,13 +313,6 @@ class TypeVar(object):
|
||||
|
||||
return TypeVar(None, None, base=self, derived_func='DoubleWidth')
|
||||
|
||||
def operand_kind(self):
|
||||
# type: () -> cdsl.operands.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 cdsl.operands.VALUE
|
||||
|
||||
def free_typevar(self):
|
||||
# type: () -> TypeVar
|
||||
if self.is_derived:
|
||||
|
||||
Reference in New Issue
Block a user