Track the default member name for immediate operands.

Usually an instruction firmat has only a single immediate operand called 'imm',
or 'cond' if it is one of the condigtion codes. Add a 'default_member' field to
ImmediateKind to keep track of this default member name in the InstructionData
struct.
This commit is contained in:
Jakob Stoklund Olesen
2016-08-23 11:39:47 -07:00
parent 2dfeea67e1
commit 7ead1e3f6f
2 changed files with 12 additions and 3 deletions

View File

@@ -237,11 +237,15 @@ variable_args = OperandKind(
class ImmediateKind(OperandKind):
"""
The kind of an immediate instruction operand.
:param default_member: The default member name of this kind the
`InstructionData` data structure.
"""
def __init__(self, name, doc):
def __init__(self, name, doc, default_member='imm'):
self.name = name
self.__doc__ = doc
self.default_member = default_member
def __repr__(self):
return 'ImmediateKind({})'.format(self.name)