Add InstructionFormat.imm_fields.
Consolidate the imm_members and imm_kinds into this list so the FormatField is the single definition of these properties. This makes it easier to access the precomputed FormatFields parametrically, avoiding going through getattr(). This is better for type checking too.
This commit is contained in:
@@ -90,7 +90,7 @@ def emit_instp(instp, fmt):
|
||||
fnames = set() # type: Set[str]
|
||||
for p in leafs:
|
||||
assert isinstance(p, FieldPredicate)
|
||||
fnames.add(p.field.name)
|
||||
fnames.add(p.field.rust_name())
|
||||
fields = ', '.join(sorted(fnames))
|
||||
|
||||
with fmt.indented('{} => {{'.format(instp.number), '}'):
|
||||
|
||||
Reference in New Issue
Block a user