mirror of
https://github.com/yasm/yasm
synced 2026-08-26 22:26:05 -04:00
gen_x86_insn.py: Warn if any groups are unused (due to a typo, for example).
svn path=/trunk/yasm/; revision=2124
This commit is contained in:
parent
457170f54e
commit
5abca04eff
1 changed files with 7 additions and 0 deletions
|
|
@ -494,9 +494,11 @@ def add_prefix(name, groupname, value, parser=None, **kwargs):
|
|||
nasm_insns[name] = prefix
|
||||
|
||||
def finalize_insns():
|
||||
unused_groups = set(groups.keys())
|
||||
for name, opts in insns.iteritems():
|
||||
for insn in opts:
|
||||
group = groups[insn.groupname]
|
||||
unused_groups.discard(insn.groupname)
|
||||
|
||||
parsers = set()
|
||||
for form in group:
|
||||
|
|
@ -539,6 +541,11 @@ def finalize_insns():
|
|||
newinsn.auto_misc_flags("nasm")
|
||||
nasm_insns[keyword] = newinsn
|
||||
|
||||
unused_groups.discard("empty")
|
||||
unused_groups.discard("not64")
|
||||
if unused_groups:
|
||||
print "warning: unused groups: %s" % ", ".join(unused_groups)
|
||||
|
||||
def output_insns(f, parser, insns):
|
||||
print >>f, "/* Generated by %s r%s, do not edit */" % \
|
||||
(scriptname, scriptrev)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue