Add ImmediateType for declaring immediate operands.

This commit is contained in:
Jakob Stoklund Olesen
2016-03-30 11:36:23 -07:00
parent 29481a5851
commit 10903503c4
4 changed files with 60 additions and 1 deletions

View File

@@ -110,3 +110,23 @@ class TypeVar(object):
def __init__(self, name):
self.name = name
#
# Immediate operands.
#
# Instances of immediate operand types are provided in the cretonne.immediates
# module.
class ImmediateType(object):
"""
The type of an immediate instruction operand.
"""
def __init__(self, name, doc):
self.name = name
self.__doc__ = doc
def __str__(self):
return self.name
def __repr__(self):
return 'ImmediateType({})'.format(self.name)