Add an InstructionFormat class to the meta language.

Define all known instruction formats in the cretonne.formats module.
This commit is contained in:
Jakob Stoklund Olesen
2016-05-12 17:28:01 -07:00
parent 814231245c
commit ef04f4fc40
3 changed files with 108 additions and 1 deletions

View File

@@ -36,7 +36,9 @@ def gen_opcodes(groups, out_dir):
if prefix:
prefix = prefix + ' = '
suffix = ', '.join(o.name for o in i.ins)
fmt.doc_comment('`{}{} {}`.'.format(prefix, i.name, suffix))
fmt.doc_comment(
'`{}{} {}`. ({})'
.format(prefix, i.name, suffix, i.format.name))
# Enum variant itself.
fmt.line(i.camel_name + ',')