Add value_opnums and imm_opnums fields to Instruction.

These two tuples contain operand indexes of the explicit value operands
and immediate operands respectively. We can no longer use the
instruction format value_operands field.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-10 09:23:55 -08:00
parent e217b04347
commit 2b209c791d
2 changed files with 21 additions and 1 deletions

View File

@@ -157,3 +157,14 @@ class Operand(object):
Is this an SSA value operand?
"""
return self.kind is VALUE
def is_immediate(self):
# type: () -> bool
"""
Is this an immediate operand?
Note that this includes both `ImmediateKind` operands *and* entity
references. It is any operand that doesn't represent a value
dependency.
"""
return self.kind is not VALUE and self.kind is not VARIABLE_ARGS